CS-Notes/docs/_style/prism-master/examples/prism-handlebars.html
2018-12-19 14:09:39 +08:00

42 lines
1.3 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h2>Comments</h2>
<pre><code>{{! This is a comment with &lt;p>some markup&lt;/p> in it }}
{{! This is a comment }} {{ this_is_not }}</code></pre>
<h2>Variables</h2>
<pre><code>&lt;p>{{ text }}&lt;/p>
&lt;h1>{{article.title}}&lt;/h1>
{{{ triple_stash_is_supported }}}
{{articles.[10].[#comments]}}</code></pre>
<h2>Strings, numbers and booleans</h2>
<pre><code>{{{link "See more..." story.url}}}
{{ true }}
{{ custom_helper 42 href="somepage.html" false }}</code></pre>
<h2>Block helpers</h2>
<pre><code>&lt;div class="body">
{{#bold}}{{body}}{{/bold}}
&lt;/div>
{{#with story}}
&lt;div class="intro">{{{intro}}}&lt;/div>
&lt;div class="body">{{{body}}}&lt;/div>
{{/with}}
&lt;div class="{{#if test}}foo{{else}}bar{{/if}}">&lt;/div>
{{#list array}}
{{@index}}. {{title}}
{{/list}}
{{#block-with-hyphens args=yep}}
This should probably work...
{{/block-with-hyphens}}
</code></pre>
<h2>Known failures</h2>
<p>There are certain edge cases where Prism will fail.
There are always such cases in every regex-based syntax highlighter.
However, Prism dares to be open and honest about them.
If a failure is listed here, it doesnt mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug.
</p>
<h3>Handlebars tag in the middle of an HTML tag</h3>
<pre><code>&lt;div{{#if test}} class="test"{{/if}}>&lt;/div></code></pre>