-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add else variant tests fixup
- Loading branch information
Showing
16 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<span class="hljs-template-tag">{{#<span class="hljs-name"><span class="hljs-builtin-name">each</span></span> filter <span class="hljs-keyword">as</span> | value index|}}</span><span class="xml"> </span><span class="hljs-template-tag">{{/<span class="hljs-name"><span class="hljs-builtin-name">each</span></span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-tag">{{#<span class="hljs-name"><span class="hljs-builtin-name">with</span></span> as <span class="hljs-keyword">as</span> | as |}}</span><span class="xml"> </span><span class="hljs-template-tag">{{/<span class="hljs-name"><span class="hljs-builtin-name">with</span></span>}}</span><span class="xml"> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{#each filter as | value index|}} {{/each}} | ||
|
||
{{#with as as | as |}} {{/with}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<span class="xml">some text | ||
|
||
</span><span class="hljs-template-tag">{{#<span class="hljs-name">custom</span> (<span class="hljs-name">nested</span> (<span class="hljs-name">helper</span> <span class="hljs-string">'a{{bc'</span> <span class="hljs-number">1</span>)) <span class="hljs-attr">key</span>=value <span class="hljs-keyword">as</span> | blockParam |}}</span><span class="xml"> some </span><span class="hljs-template-variable">{{<span class="hljs-name">blockParam</span>}}</span><span class="xml"> text </span><span class="hljs-template-tag">{{/<span class="hljs-name">custom</span>}}</span><span class="xml"> | ||
|
||
some text | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
some text | ||
|
||
{{#custom (nested (helper 'a{{bc' 1)) key=value as | blockParam |}} some {{blockParam}} text {{/custom}} | ||
|
||
some text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<span class="hljs-template-tag">{{#<span class="hljs-name">helper</span>}}</span><span class="hljs-keyword">{{else}}</span><span class="xml">else-block</span><span class="hljs-template-tag">{{/<span class="hljs-name">helper</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-tag">{{#<span class="hljs-name">helper</span>}}</span><span class="xml">block</span><span class="hljs-keyword">{{else}}</span><span class="xml">else-block</span><span class="hljs-template-tag">{{/<span class="hljs-name">helper</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">[else]</span>}}</span><span class="xml"> in brackets is a helper, not a keyword | ||
|
||
</span><span class="hljs-template-tag">{{#<span class="hljs-name">else</span>}}</span><span class="xml"> as block helper name is not a keyword </span><span class="hljs-template-tag">{{/<span class="hljs-name">else</span>}}</span><span class="xml"> | ||
|
||
\{{else}} is not a keyword if escaped | ||
|
||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{#helper}}{{else}}else-block{{/helper}} | ||
|
||
{{#helper}}block{{else}}else-block{{/helper}} | ||
|
||
{{[else]}} in brackets is a helper, not a keyword | ||
|
||
{{#else}} as block helper name is not a keyword {{/else}} | ||
|
||
\{{else}} is not a keyword if escaped | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<span class="hljs-template-variable">{{<span class="hljs-name">helper</span> <span class="hljs-attr">key</span>=value}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{{<span class="hljs-name">helper</span> <span class="hljs-attr">key</span>=value}}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{><span class="hljs-name"><span class="hljs-builtin-name">partial</span></span> <span class="hljs-attr">key</span>=value}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-tag">{{#<span class="hljs-name">helper</span> <span class="hljs-attr">key</span>=value}}</span><span class="xml"> </span><span class="hljs-template-tag">{{/<span class="hljs-name">helper</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-tag">{{{{#<span class="hljs-name">helper</span> <span class="hljs-attr">key</span>=value}}}}</span><span class="xml"> </span><span class="hljs-template-tag">{{{{/<span class="hljs-name">helper</span>}}}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">helper</span> (<span class="hljs-name">subExpression</span> <span class="hljs-attr">key</span>=value)}}</span><span class="xml"> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{helper key=value}} | ||
|
||
{{{helper key=value}}} | ||
|
||
{{>partial key=value}} | ||
|
||
{{#helper key=value}} {{/helper}} | ||
|
||
{{{{#helper key=value}}}} {{{{/helper}}}} | ||
|
||
{{helper (subExpression key=value)}} |
14 changes: 14 additions & 0 deletions
14
test/markup/handlebars/literals-in-different-places.expect.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<span class="hljs-template-variable">{{<span class="hljs-name">helper</span> <span class="hljs-literal">true</span> <span class="hljs-literal">false</span> <span class="hljs-attr">a</span>=<span class="hljs-literal">true</span> <span class="hljs-attr">b</span>=<span class="hljs-literal">false</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{{<span class="hljs-name">helper</span> <span class="hljs-literal">true</span> <span class="hljs-literal">false</span>}}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-tag">{{#<span class="hljs-name">helper</span> <span class="hljs-literal">true</span> <span class="hljs-literal">false</span>}}</span><span class="xml"> </span><span class="hljs-template-tag">{{/<span class="hljs-name">helper</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-tag">{{{{#<span class="hljs-name">helper</span> <span class="hljs-literal">true</span> <span class="hljs-literal">false</span>}}}}</span><span class="xml"> </span><span class="hljs-template-tag">{{{{/<span class="hljs-name">helper</span>}}}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{><span class="hljs-name"><span class="hljs-builtin-name">partial</span></span> <span class="hljs-literal">true</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">helper</span> (<span class="hljs-name">helper</span> <span class="hljs-literal">true</span> <span class="hljs-literal">false</span>)}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">helper</span> <span class="hljs-attr">a</span>=<span class="hljs-literal">true</span> <span class="hljs-attr">b</span>=<span class="hljs-literal">false</span>}}</span><span class="xml"> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{helper true false a=true b=false}} | ||
|
||
{{{helper true false}}} | ||
|
||
{{#helper true false}} {{/helper}} | ||
|
||
{{{{#helper true false}}}} {{{{/helper}}}} | ||
|
||
{{>partial true}} | ||
|
||
{{helper (helper true false)}} | ||
|
||
{{helper a=true b=false}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<span class="hljs-template-variable">{{<span class="hljs-name">helper</span> <span class="hljs-literal">true</span> <span class="hljs-literal">false</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">helper</span> <span class="hljs-number">1234</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">helper</span> <span class="hljs-literal">null</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">helper</span> <span class="hljs-literal">undefined</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">helper</span> <span class="hljs-string">'string'</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">helper</span> <span class="hljs-string">"string"</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">helper</span> [not a string literal but a variable]}}</span><span class="xml"> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{helper true false}} | ||
|
||
{{helper 1234}} | ||
|
||
{{helper null}} | ||
|
||
{{helper undefined}} | ||
|
||
{{helper 'string'}} | ||
|
||
{{helper "string"}} | ||
|
||
{{helper [not a string literal but a variable]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<span class="hljs-template-variable">{{<span class="hljs-name">path.expression</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{{<span class="hljs-name">path.expression</span>}}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-tag">{{#<span class="hljs-name">path.expression</span>}}</span><span class="xml"> </span><span class="hljs-template-tag">{{/<span class="hljs-name">path.expression</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-tag">{{{{#<span class="hljs-name">path.expression</span>}}}}</span><span class="xml"> </span><span class="hljs-template-tag">{{{{/<span class="hljs-name">path.expression</span>}}}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">with.in.a.path.expression</span>}}</span><span class="xml"> is not a built-in | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{path.expression}} | ||
|
||
{{{path.expression}}} | ||
|
||
{{#path.expression}} {{/path.expression}} | ||
|
||
{{{{#path.expression}}}} {{{{/path.expression}}}} | ||
|
||
{{with.in.a.path.expression}} is not a built-in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
<span class="hljs-template-variable">{{<span class="hljs-name">helper</span> (<span class="hljs-name">subExpression</span> <span class="hljs-number">1</span> <span class="hljs-number">2</span>)}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{{<span class="hljs-name">helper</span> (<span class="hljs-name">subExpression</span> <span class="hljs-number">1</span> <span class="hljs-number">2</span>)}}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-tag">{{{{#<span class="hljs-name">helper</span> (<span class="hljs-name">subExpression</span> <span class="hljs-number">1</span> <span class="hljs-number">2</span>)}}}}</span><span class="xml"> </span><span class="hljs-template-tag">{{{{/<span class="hljs-name">helper</span>}}}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-tag">{{#<span class="hljs-name">helper</span> (<span class="hljs-name">subExpression</span> <span class="hljs-number">1</span> <span class="hljs-number">2</span>)}}</span><span class="xml"> </span><span class="hljs-template-tag">{{/<span class="hljs-name">helper</span>}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{><span class="hljs-name"><span class="hljs-builtin-name">partial</span></span> (<span class="hljs-name">subExpression</span> <span class="hljs-number">1</span> <span class="hljs-number">2</span>)}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">helper</span> <span class="hljs-attr">key</span>=(<span class="hljs-name">subExpression</span> <span class="hljs-number">1</span> <span class="hljs-number">2</span>)}}</span><span class="xml"> | ||
|
||
</span><span class="hljs-template-variable">{{<span class="hljs-name">helper</span> (<span class="hljs-name">subExpression</span> (<span class="hljs-name">canBeNested</span> <span class="hljs-number">1</span> <span class="hljs-number">2</span>) anotherParam)}}</span><span class="xml"> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
{{helper (subExpression 1 2)}} | ||
|
||
{{{helper (subExpression 1 2)}}} | ||
|
||
{{{{#helper (subExpression 1 2)}}}} {{{{/helper}}}} | ||
|
||
{{#helper (subExpression 1 2)}} {{/helper}} | ||
|
||
{{>partial (subExpression 1 2)}} | ||
|
||
{{helper key=(subExpression 1 2)}} | ||
|
||
{{helper (subExpression (canBeNested 1 2) anotherParam)}} |