-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(handlebars) support for segment-literals and escaped mustaches (#2184)
- Loading branch information
1 parent
e859d30
commit bdf87d2
Showing
11 changed files
with
209 additions
and
26 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
9 changes: 9 additions & 0 deletions
9
test/markup/handlebars/block-expression-variants-as-path-segment.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,9 @@ | ||
<span class="xml">text </span><span class="hljs-template-tag">{{#<span class="hljs-name">abc</span> abcd.[lite"'ral}}segment] }}</span><span class="xml">a</span><span class="hljs-template-tag">{{/<span class="hljs-name">abc</span>}}</span><span class="xml"> | ||
|
||
text </span><span class="hljs-template-tag">{{#<span class="hljs-name">abc</span> abcd."lite]'ral}}segment" }}</span><span class="xml">a</span><span class="hljs-template-tag">{{/<span class="hljs-name">abc</span>}}</span><span class="xml"> | ||
|
||
text </span><span class="hljs-template-tag">{{#<span class="hljs-name">abc</span> abcd.'lite]"ral}}segment' }}</span><span class="xml">a</span><span class="hljs-template-tag">{{/<span class="hljs-name">abc</span>}}</span><span class="xml"> | ||
|
||
text | ||
|
||
</span> |
8 changes: 8 additions & 0 deletions
8
test/markup/handlebars/block-expression-variants-as-path-segment.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,8 @@ | ||
text {{#abc abcd.[lite"'ral}}segment] }}a{{/abc}} | ||
|
||
text {{#abc abcd."lite]'ral}}segment" }}a{{/abc}} | ||
|
||
text {{#abc abcd.'lite]"ral}}segment' }}a{{/abc}} | ||
|
||
text | ||
|
14 changes: 14 additions & 0 deletions
14
test/markup/handlebars/block-expression-variants-in-helper-name.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="xml">text </span><span class="hljs-template-tag">{{#<span class="hljs-name">[ab}}c]</span> param }}</span><span class="xml">a</span><span class="hljs-template-tag">{{/<span class="hljs-name">[ab}}c]</span>}}</span><span class="xml"> | ||
|
||
text </span><span class="hljs-template-tag">{{#<span class="hljs-name">'ab}}c'</span> param}}</span><span class="xml">a</span><span class="hljs-template-tag">{{/<span class="hljs-name">'ab}}c'</span>}}</span><span class="xml"> | ||
|
||
text </span><span class="hljs-template-tag">{{#<span class="hljs-name">"ab}}c"</span> param}}</span><span class="xml">a</span><span class="hljs-template-tag">{{/<span class="hljs-name">"ab}}c"</span>}}</span><span class="xml"> | ||
|
||
text </span><span class="hljs-template-tag">{{#<span class="hljs-name">""</span> param}}</span><span class="xml">a</span><span class="hljs-template-tag">{{/<span class="hljs-name">""</span>}}</span><span class="xml"> | ||
|
||
text </span><span class="hljs-template-tag">{{#<span class="hljs-name">''</span> param}}</span><span class="xml">a</span><span class="hljs-template-tag">{{/<span class="hljs-name">''</span>}}</span><span class="xml"> | ||
|
||
text </span><span class="hljs-template-tag">{{#<span class="hljs-name">[]</span> param}}</span><span class="xml">a</span><span class="hljs-template-tag">{{/<span class="hljs-name">[]</span>}}</span><span class="xml"> | ||
|
||
text | ||
</span> |
13 changes: 13 additions & 0 deletions
13
test/markup/handlebars/block-expression-variants-in-helper-name.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,13 @@ | ||
text {{#[ab}}c] param }}a{{/[ab}}c]}} | ||
|
||
text {{#'ab}}c' param}}a{{/'ab}}c'}} | ||
|
||
text {{#"ab}}c" param}}a{{/"ab}}c"}} | ||
|
||
text {{#"" param}}a{{/""}} | ||
|
||
text {{#'' param}}a{{/''}} | ||
|
||
text {{#[] param}}a{{/[]}} | ||
|
||
text |
8 changes: 8 additions & 0 deletions
8
test/markup/handlebars/block-expression-variants-in-param.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,8 @@ | ||
<span class="xml">text </span><span class="hljs-template-tag">{{#<span class="hljs-name">abc</span> "lite]'ral}}segment" }}</span><span class="xml">a</span><span class="hljs-template-tag">{{/<span class="hljs-name">abc</span>}}</span><span class="xml"> | ||
|
||
text </span><span class="hljs-template-tag">{{#<span class="hljs-name">abc</span> 'lite]"ral}}segment' }}</span><span class="xml">a</span><span class="hljs-template-tag">{{/<span class="hljs-name">abc</span>}}</span><span class="xml"> | ||
|
||
text </span><span class="hljs-template-tag">{{#<span class="hljs-name">abc</span> [lite"'ral}}segment] }}</span><span class="xml">a</span><span class="hljs-template-tag">{{/<span class="hljs-name">abc</span>}}</span><span class="xml"> | ||
|
||
text | ||
</span> |
7 changes: 7 additions & 0 deletions
7
test/markup/handlebars/block-expression-variants-in-param.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,7 @@ | ||
text {{#abc "lite]'ral}}segment" }}a{{/abc}} | ||
|
||
text {{#abc 'lite]"ral}}segment' }}a{{/abc}} | ||
|
||
text {{#abc [lite"'ral}}segment] }}a{{/abc}} | ||
|
||
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,22 @@ | ||
<span class="xml">\{{no-expression}} | ||
|
||
\{{{no-expression}}} | ||
|
||
\{{#no}} block \{{/no}} | ||
|
||
\{{\{{no}}}} block \{{\{{/no}}}} | ||
|
||
\{{!-- no comment --}} | ||
|
||
\{{! no comment }} | ||
|
||
<span class="hljs-comment"><!-- escaped escapings --></span> | ||
|
||
\\</span><span class="hljs-template-variable">{{expression}}</span><span class="xml"> | ||
|
||
\\\</span><span class="hljs-template-variable">{{expression}}</span><span class="xml"> | ||
|
||
\\\\</span><span class="hljs-template-variable">{{expression}}</span><span class="xml"> | ||
|
||
\\\</span><span class="hljs-comment">{{! comment }}</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,21 @@ | ||
\{{no-expression}} | ||
|
||
\{{{no-expression}}} | ||
|
||
\{{#no}} block \{{/no}} | ||
|
||
\{{\{{no}}}} block \{{\{{/no}}}} | ||
|
||
\{{!-- no comment --}} | ||
|
||
\{{! no comment }} | ||
|
||
<!-- escaped escapings --> | ||
|
||
\\{{expression}} | ||
|
||
\\\{{expression}} | ||
|
||
\\\\{{expression}} | ||
|
||
\\\{{! comment }} |
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,27 @@ | ||
<span class="xml">text | ||
|
||
</span><span class="hljs-template-variable">{{ "lite]'ral}}segment" }}</span><span class="xml"> text | ||
|
||
</span><span class="hljs-template-variable">{{ 'lite]"ral}}segment' }}</span><span class="xml"> text | ||
|
||
</span><span class="hljs-template-variable">{{ [lite"'ral}}segment] }}</span><span class="xml"> text | ||
|
||
</span><span class="hljs-template-variable">{{ abc "lite]'ral}}segment" }}</span><span class="xml"> text | ||
|
||
</span><span class="hljs-template-variable">{{ abc 'lite]"ral}}segment' }}</span><span class="xml"> text | ||
|
||
</span><span class="hljs-template-variable">{{ abc [lite"'ral}}segment] }}</span><span class="xml"> text | ||
|
||
|
||
</span><span class="hljs-template-variable">{{ abcd.[lite"'ral}}segment] }}</span><span class="xml"> text | ||
|
||
</span><span class="hljs-template-variable">{{ abcd."lite]'ral}}segment" }}</span><span class="xml"> text | ||
|
||
</span><span class="hljs-template-variable">{{ abcd.'lite]"ral}}segment' }}</span><span class="xml"> text | ||
|
||
</span><span class="hljs-template-variable">{{ abcd.''}}</span><span class="xml"> text | ||
|
||
</span><span class="hljs-template-variable">{{ abcd."" }}</span><span class="xml"> text | ||
|
||
</span><span class="hljs-template-variable">{{ abcd.[] }}</span><span class="xml"> 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,26 @@ | ||
text | ||
|
||
{{ "lite]'ral}}segment" }} text | ||
|
||
{{ 'lite]"ral}}segment' }} text | ||
|
||
{{ [lite"'ral}}segment] }} text | ||
|
||
{{ abc "lite]'ral}}segment" }} text | ||
|
||
{{ abc 'lite]"ral}}segment' }} text | ||
|
||
{{ abc [lite"'ral}}segment] }} text | ||
|
||
|
||
{{ abcd.[lite"'ral}}segment] }} text | ||
|
||
{{ abcd."lite]'ral}}segment" }} text | ||
|
||
{{ abcd.'lite]"ral}}segment' }} text | ||
|
||
{{ abcd.''}} text | ||
|
||
{{ abcd."" }} text | ||
|
||
{{ abcd.[] }} text |