From 35ccc531f9b4d8f97ed2516183f5bd561ab1c5bb Mon Sep 17 00:00:00 2001 From: Aleksandr Kanunnikov Date: Fri, 10 Jan 2020 23:41:33 +0300 Subject: [PATCH 1/6] feat: handlebars - dot in path names --- components/prism-handlebars.js | 4 ++-- tests/languages/handlebars/block_feature.test | 20 +++++++------------ .../handlebars/punctuation_feature.test | 12 +++++++++++ .../handlebars/variable_feature.test | 15 ++++++++++++++ 4 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 tests/languages/handlebars/punctuation_feature.test create mode 100644 tests/languages/handlebars/variable_feature.test diff --git a/components/prism-handlebars.js b/components/prism-handlebars.js index e23933d467..65af27feb0 100644 --- a/components/prism-handlebars.js +++ b/components/prism-handlebars.js @@ -21,8 +21,8 @@ variable: /[\s\S]+/ } }, - 'punctuation': /[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/, - 'variable': /[^!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~\s]+/ + 'punctuation': /[!"#%&':()*+,\.\/;<=>@\[\\\]^`{|}~]/, + 'variable': /[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/ }; Prism.hooks.add('before-tokenize', function(env) { diff --git a/tests/languages/handlebars/block_feature.test b/tests/languages/handlebars/block_feature.test index dd2c74e9c7..c218d638c9 100644 --- a/tests/languages/handlebars/block_feature.test +++ b/tests/languages/handlebars/block_feature.test @@ -1,22 +1,16 @@ {{#each comments}}{{/each}} {{~#if isActive~}}{{~/if~}} +{{#let a as |b|}}{{/let}} ---------------------------------------------------- [ - ["handlebars", [ - ["delimiter", "{{"], ["block", "#each"], ["variable", "comments"], ["delimiter", "}}"] - ]], - ["handlebars", [ - ["delimiter", "{{"], ["block", "/each"], ["delimiter", "}}"] - ]], - ["handlebars", [ - ["delimiter", "{{"], ["punctuation", "~"], ["block", "#if"], ["variable", "isActive"], ["punctuation", "~"], ["delimiter", "}}"] - ]], - ["handlebars", [ - ["delimiter", "{{"], ["punctuation", "~"], ["block", "/if"], ["punctuation", "~"], ["delimiter", "}}"] - ]] -] + ["handlebars",[["delimiter","{{"],["block","#each"],["variable","comments"],["delimiter","}}"]]], + ["handlebars",[["delimiter","{{"],["block","/each"],["delimiter","}}"]]], + ["handlebars",[["delimiter","{{"],["punctuation","~"],["block","#if"],["variable","isActive"],["punctuation","~"],["delimiter","}}"]]], + ["handlebars",[["delimiter","{{"],["punctuation","~"],["block","/if"],["punctuation","~"],["delimiter","}}"]]], + ["handlebars",[["delimiter","{{"],["block","#let"],["variable","a"],["variable","as"],["punctuation","|"],["variable","b"],["punctuation","|"],["delimiter","}}"]]], + ["handlebars",[["delimiter","{{"],["block","/let"],["delimiter","}}"]]]] ---------------------------------------------------- diff --git a/tests/languages/handlebars/punctuation_feature.test b/tests/languages/handlebars/punctuation_feature.test new file mode 100644 index 0000000000..61229bfb54 --- /dev/null +++ b/tests/languages/handlebars/punctuation_feature.test @@ -0,0 +1,12 @@ +{{~#if isActive~}}{{~/if~}} + +---------------------------------------------------- + +[ + ["handlebars",[["delimiter","{{"],["punctuation","~"],["block","#if"],["variable","isActive"],["punctuation","~"],["delimiter","}}"]]], + ["handlebars",[["delimiter","{{"],["punctuation","~"],["block","/if"],["punctuation","~"],["delimiter","}}"]]] +] + +---------------------------------------------------- + +Checks for punctuation. \ No newline at end of file diff --git a/tests/languages/handlebars/variable_feature.test b/tests/languages/handlebars/variable_feature.test new file mode 100644 index 0000000000..c4de8f427d --- /dev/null +++ b/tests/languages/handlebars/variable_feature.test @@ -0,0 +1,15 @@ +{{comments}} +{{@comments}} +{{this.comments}} + +---------------------------------------------------- + +[ + ["handlebars",[["delimiter","{{"],["variable","comments"],["delimiter","}}"]]], + ["handlebars",[["delimiter","{{"],["punctuation","@"],["variable","comments"],["delimiter","}}"]]], + ["handlebars",[["delimiter","{{"],["variable","this"],["punctuation","."],["variable","comments"],["delimiter","}}"]]] +] + +---------------------------------------------------- + +Checks for variable. \ No newline at end of file From f7aefa03653cb12defd4330e85502d2951b9abd7 Mon Sep 17 00:00:00 2001 From: Aleksandr Kanunnikov Date: Fri, 10 Jan 2020 23:55:20 +0300 Subject: [PATCH 2/6] handlebars + html --- .../handlebars_in_html_feature.test | 273 ++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100644 tests/languages/handlebars/handlebars_in_html_feature.test diff --git a/tests/languages/handlebars/handlebars_in_html_feature.test b/tests/languages/handlebars/handlebars_in_html_feature.test new file mode 100644 index 0000000000..eb3b907f9c --- /dev/null +++ b/tests/languages/handlebars/handlebars_in_html_feature.test @@ -0,0 +1,273 @@ +{{aUserModel.name}} +
{{listOfUsers.firstObject.name}}
+{{if name "I have a name" "I have no name"}} + +
+---------------------------------------------------- + +[ + [ + "handlebars", + [ + [ + "delimiter", + "{{" + ], + [ + "variable", + "aUserModel" + ], + [ + "punctuation", + "." + ], + [ + "variable", + "name" + ], + [ + "delimiter", + "}}" + ] + ] + ], + [ + "tag", + [ + [ + "tag", + [ + [ + "punctuation", + "<" + ], + "div" + ] + ], + [ + "punctuation", + ">" + ] + ] + ], + [ + "handlebars", + [ + [ + "delimiter", + "{{" + ], + [ + "variable", + "listOfUsers" + ], + [ + "punctuation", + "." + ], + [ + "variable", + "firstObject" + ], + [ + "punctuation", + "." + ], + [ + "variable", + "name" + ], + [ + "delimiter", + "}}" + ] + ] + ], + [ + "tag", + [ + [ + "tag", + [ + [ + "punctuation", + "" + ] + ] + ], + [ + "handlebars", + [ + [ + "delimiter", + "{{" + ], + [ + "variable", + "if" + ], + [ + "variable", + "name" + ], + [ + "string", + "\"I have a name\"" + ], + [ + "string", + "\"I have no name\"" + ], + [ + "delimiter", + "}}" + ] + ] + ], + [ + "tag", + [ + [ + "tag", + [ + [ + "punctuation", + "<" + ], + "span" + ] + ], + [ + "attr-name", + [ + "data-has-name" + ] + ], + [ + "attr-value", + [ + [ + "punctuation", + "=" + ], + [ + "handlebars", + [ + [ + "delimiter", + "{{" + ], + [ + "variable", + "if" + ], + [ + "variable", + "name" + ], + [ + "boolean", + "true" + ], + [ + "delimiter", + "}}" + ] + ] + ] + ] + ], + [ + "punctuation", + ">" + ] + ] + ], + [ + "tag", + [ + [ + "tag", + [ + [ + "punctuation", + "" + ] + ] + ], + [ + "tag", + [ + [ + "tag", + [ + [ + "punctuation", + "<" + ], + "div" + ] + ], + [ + "attr-name", + [ + [ + "handlebars", + [ + [ + "delimiter", + "{{" + ], + [ + "variable", + "on" + ], + [ + "string", + "\"click\"" + ], + [ + "variable", + "this" + ], + [ + "punctuation", + "." + ], + [ + "variable", + "hello" + ], + [ + "delimiter", + "}}" + ] + ] + ] + ] + ], + [ + "punctuation", + "/>" + ] + ] + ] +] + +---------------------------------------------------- + +Checks for handlebars filter in Html. \ No newline at end of file From 786108d122f00fd95674c2c46b3e650d4f6787e2 Mon Sep 17 00:00:00 2001 From: Aleksandr Kanunnikov Date: Sat, 11 Jan 2020 00:04:59 +0300 Subject: [PATCH 3/6] min.js --- components/prism-handlebars.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/prism-handlebars.min.js b/components/prism-handlebars.min.js index 7fbab5cc83..19afa63201 100644 --- a/components/prism-handlebars.min.js +++ b/components/prism-handlebars.min.js @@ -1 +1 @@ -!function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:true|false)\b/,block:{pattern:/^(\s*~?\s*)[#\/]\S+?(?=\s*~?\s*$|\s)/i,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",function(a){e.languages["markup-templating"].buildPlaceholders(a,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)}),e.hooks.add("after-tokenize",function(a){e.languages["markup-templating"].tokenizePlaceholders(a,"handlebars")})}(Prism); \ No newline at end of file +!function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:true|false)\b/,block:{pattern:/^(\s*~?\s*)[#\/]\S+?(?=\s*~?\s*$|\s)/i,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,\.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",function(a){e.languages["markup-templating"].buildPlaceholders(a,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)}),e.hooks.add("after-tokenize",function(a){e.languages["markup-templating"].tokenizePlaceholders(a,"handlebars")})}(Prism); \ No newline at end of file From 84eab110bfd762812944a2abb5709b6b5bf26d74 Mon Sep 17 00:00:00 2001 From: Aleksandr Kanunnikov Date: Sat, 11 Jan 2020 01:17:14 +0300 Subject: [PATCH 4/6] test: punctuation update --- .../handlebars/punctuation_feature.test | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/tests/languages/handlebars/punctuation_feature.test b/tests/languages/handlebars/punctuation_feature.test index 61229bfb54..29a230f746 100644 --- a/tests/languages/handlebars/punctuation_feature.test +++ b/tests/languages/handlebars/punctuation_feature.test @@ -1,10 +1,29 @@ {{~#if isActive~}}{{~/if~}} - +{{:slot-name}} ---------------------------------------------------- - + [ - ["handlebars",[["delimiter","{{"],["punctuation","~"],["block","#if"],["variable","isActive"],["punctuation","~"],["delimiter","}}"]]], - ["handlebars",[["delimiter","{{"],["punctuation","~"],["block","/if"],["punctuation","~"],["delimiter","}}"]]] + ["handlebars", [ + ["delimiter", "{{"], + ["punctuation", "~"], + ["block", "#if"], + ["variable", "isActive"], + ["punctuation", "~"], + ["delimiter", "}}"] + ]], + ["handlebars", [ + ["delimiter", "{{"], + ["punctuation", "~"], + ["block", "/if"], + ["punctuation", "~"], + ["delimiter", "}}"] + ]], + ["handlebars", [ + ["delimiter", "{{"], + ["punctuation", ":"], + ["variable", "slot-name"], + ["delimiter", "}}"] + ]] ] ---------------------------------------------------- From ae7a2e471aea7719cc4272be46ab9900934b1aef Mon Sep 17 00:00:00 2001 From: Alex Kanunnikov Date: Sat, 11 Jan 2020 01:19:31 +0300 Subject: [PATCH 5/6] Update components/prism-handlebars.js Co-Authored-By: Michael Schmidt --- components/prism-handlebars.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/prism-handlebars.js b/components/prism-handlebars.js index 65af27feb0..7a7f5a41b1 100644 --- a/components/prism-handlebars.js +++ b/components/prism-handlebars.js @@ -21,7 +21,7 @@ variable: /[\s\S]+/ } }, - 'punctuation': /[!"#%&':()*+,\.\/;<=>@\[\\\]^`{|}~]/, + 'punctuation': /[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/, 'variable': /[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/ }; From e24a25a5b788ff7086800d6babed44f02c7ecb23 Mon Sep 17 00:00:00 2001 From: Aleksandr Kanunnikov Date: Sat, 11 Jan 2020 01:26:54 +0300 Subject: [PATCH 6/6] chore: remove extra escape and fix tests --- components/prism-handlebars.min.js | 2 +- tests/languages/handlebars/block_feature.test | 25 +- .../handlebars_in_html_feature.test | 520 +++++++++--------- .../handlebars/punctuation_feature.test | 44 +- .../handlebars/variable_feature.test | 12 +- 5 files changed, 311 insertions(+), 292 deletions(-) diff --git a/components/prism-handlebars.min.js b/components/prism-handlebars.min.js index 19afa63201..4c8151f3ba 100644 --- a/components/prism-handlebars.min.js +++ b/components/prism-handlebars.min.js @@ -1 +1 @@ -!function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:true|false)\b/,block:{pattern:/^(\s*~?\s*)[#\/]\S+?(?=\s*~?\s*$|\s)/i,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,\.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",function(a){e.languages["markup-templating"].buildPlaceholders(a,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)}),e.hooks.add("after-tokenize",function(a){e.languages["markup-templating"].tokenizePlaceholders(a,"handlebars")})}(Prism); \ No newline at end of file +!function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:true|false)\b/,block:{pattern:/^(\s*~?\s*)[#\/]\S+?(?=\s*~?\s*$|\s)/i,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",function(a){e.languages["markup-templating"].buildPlaceholders(a,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)}),e.hooks.add("after-tokenize",function(a){e.languages["markup-templating"].tokenizePlaceholders(a,"handlebars")})}(Prism); \ No newline at end of file diff --git a/tests/languages/handlebars/block_feature.test b/tests/languages/handlebars/block_feature.test index c218d638c9..46182ddd43 100644 --- a/tests/languages/handlebars/block_feature.test +++ b/tests/languages/handlebars/block_feature.test @@ -5,12 +5,25 @@ ---------------------------------------------------- [ - ["handlebars",[["delimiter","{{"],["block","#each"],["variable","comments"],["delimiter","}}"]]], - ["handlebars",[["delimiter","{{"],["block","/each"],["delimiter","}}"]]], - ["handlebars",[["delimiter","{{"],["punctuation","~"],["block","#if"],["variable","isActive"],["punctuation","~"],["delimiter","}}"]]], - ["handlebars",[["delimiter","{{"],["punctuation","~"],["block","/if"],["punctuation","~"],["delimiter","}}"]]], - ["handlebars",[["delimiter","{{"],["block","#let"],["variable","a"],["variable","as"],["punctuation","|"],["variable","b"],["punctuation","|"],["delimiter","}}"]]], - ["handlebars",[["delimiter","{{"],["block","/let"],["delimiter","}}"]]]] + ["handlebars",[ + ["delimiter","{{"],["block","#each"],["variable","comments"],["delimiter","}}"]] + ], + ["handlebars",[ + ["delimiter","{{"],["block","/each"],["delimiter","}}"]] + ], + ["handlebars",[ + ["delimiter","{{"],["punctuation","~"],["block","#if"],["variable","isActive"],["punctuation","~"],["delimiter","}}"]] + ], + ["handlebars",[ + ["delimiter","{{"],["punctuation","~"],["block","/if"],["punctuation","~"],["delimiter","}}"]] + ], + ["handlebars",[ + ["delimiter","{{"],["block","#let"],["variable","a"],["variable","as"],["punctuation","|"],["variable","b"],["punctuation","|"],["delimiter","}}"]] + ], + ["handlebars",[ + ["delimiter","{{"],["block","/let"],["delimiter","}}"]] + ] +] ---------------------------------------------------- diff --git a/tests/languages/handlebars/handlebars_in_html_feature.test b/tests/languages/handlebars/handlebars_in_html_feature.test index eb3b907f9c..1c2dafea96 100644 --- a/tests/languages/handlebars/handlebars_in_html_feature.test +++ b/tests/languages/handlebars/handlebars_in_html_feature.test @@ -6,266 +6,266 @@ ---------------------------------------------------- [ - [ - "handlebars", - [ - [ - "delimiter", - "{{" - ], - [ - "variable", - "aUserModel" - ], - [ - "punctuation", - "." - ], - [ - "variable", - "name" - ], - [ - "delimiter", - "}}" - ] - ] - ], - [ - "tag", - [ - [ - "tag", - [ - [ - "punctuation", - "<" - ], - "div" - ] - ], - [ - "punctuation", - ">" - ] - ] - ], - [ - "handlebars", - [ - [ - "delimiter", - "{{" - ], - [ - "variable", - "listOfUsers" - ], - [ - "punctuation", - "." - ], - [ - "variable", - "firstObject" - ], - [ - "punctuation", - "." - ], - [ - "variable", - "name" - ], - [ - "delimiter", - "}}" - ] - ] - ], - [ - "tag", - [ - [ - "tag", - [ - [ - "punctuation", - "" - ] - ] - ], - [ - "handlebars", - [ - [ - "delimiter", - "{{" - ], - [ - "variable", - "if" - ], - [ - "variable", - "name" - ], - [ - "string", - "\"I have a name\"" - ], - [ - "string", - "\"I have no name\"" - ], - [ - "delimiter", - "}}" - ] - ] - ], - [ - "tag", - [ - [ - "tag", - [ - [ - "punctuation", - "<" - ], - "span" - ] - ], - [ - "attr-name", - [ - "data-has-name" - ] - ], - [ - "attr-value", - [ - [ - "punctuation", - "=" - ], - [ - "handlebars", - [ - [ - "delimiter", - "{{" - ], - [ - "variable", - "if" - ], - [ - "variable", - "name" - ], - [ - "boolean", - "true" - ], - [ - "delimiter", - "}}" - ] - ] - ] - ] - ], - [ - "punctuation", - ">" - ] - ] - ], - [ - "tag", - [ - [ - "tag", - [ - [ - "punctuation", - "" - ] - ] - ], - [ - "tag", - [ - [ - "tag", - [ - [ - "punctuation", - "<" - ], - "div" - ] - ], - [ - "attr-name", - [ - [ - "handlebars", - [ - [ - "delimiter", - "{{" - ], - [ - "variable", - "on" - ], - [ - "string", - "\"click\"" - ], - [ - "variable", - "this" - ], - [ - "punctuation", - "." - ], - [ - "variable", - "hello" - ], - [ - "delimiter", - "}}" - ] - ] - ] - ] - ], - [ - "punctuation", - "/>" - ] - ] - ] + [ + "handlebars", + [ + [ + "delimiter", + "{{" + ], + [ + "variable", + "aUserModel" + ], + [ + "punctuation", + "." + ], + [ + "variable", + "name" + ], + [ + "delimiter", + "}}" + ] + ] + ], + [ + "tag", + [ + [ + "tag", + [ + [ + "punctuation", + "<" + ], + "div" + ] + ], + [ + "punctuation", + ">" + ] + ] + ], + [ + "handlebars", + [ + [ + "delimiter", + "{{" + ], + [ + "variable", + "listOfUsers" + ], + [ + "punctuation", + "." + ], + [ + "variable", + "firstObject" + ], + [ + "punctuation", + "." + ], + [ + "variable", + "name" + ], + [ + "delimiter", + "}}" + ] + ] + ], + [ + "tag", + [ + [ + "tag", + [ + [ + "punctuation", + "" + ] + ] + ], + [ + "handlebars", + [ + [ + "delimiter", + "{{" + ], + [ + "variable", + "if" + ], + [ + "variable", + "name" + ], + [ + "string", + "\"I have a name\"" + ], + [ + "string", + "\"I have no name\"" + ], + [ + "delimiter", + "}}" + ] + ] + ], + [ + "tag", + [ + [ + "tag", + [ + [ + "punctuation", + "<" + ], + "span" + ] + ], + [ + "attr-name", + [ + "data-has-name" + ] + ], + [ + "attr-value", + [ + [ + "punctuation", + "=" + ], + [ + "handlebars", + [ + [ + "delimiter", + "{{" + ], + [ + "variable", + "if" + ], + [ + "variable", + "name" + ], + [ + "boolean", + "true" + ], + [ + "delimiter", + "}}" + ] + ] + ] + ] + ], + [ + "punctuation", + ">" + ] + ] + ], + [ + "tag", + [ + [ + "tag", + [ + [ + "punctuation", + "" + ] + ] + ], + [ + "tag", + [ + [ + "tag", + [ + [ + "punctuation", + "<" + ], + "div" + ] + ], + [ + "attr-name", + [ + [ + "handlebars", + [ + [ + "delimiter", + "{{" + ], + [ + "variable", + "on" + ], + [ + "string", + "\"click\"" + ], + [ + "variable", + "this" + ], + [ + "punctuation", + "." + ], + [ + "variable", + "hello" + ], + [ + "delimiter", + "}}" + ] + ] + ] + ] + ], + [ + "punctuation", + "/>" + ] + ] + ] ] ---------------------------------------------------- diff --git a/tests/languages/handlebars/punctuation_feature.test b/tests/languages/handlebars/punctuation_feature.test index 29a230f746..8276813b78 100644 --- a/tests/languages/handlebars/punctuation_feature.test +++ b/tests/languages/handlebars/punctuation_feature.test @@ -1,29 +1,29 @@ {{~#if isActive~}}{{~/if~}} {{:slot-name}} ---------------------------------------------------- - + [ - ["handlebars", [ - ["delimiter", "{{"], - ["punctuation", "~"], - ["block", "#if"], - ["variable", "isActive"], - ["punctuation", "~"], - ["delimiter", "}}"] - ]], - ["handlebars", [ - ["delimiter", "{{"], - ["punctuation", "~"], - ["block", "/if"], - ["punctuation", "~"], - ["delimiter", "}}"] - ]], - ["handlebars", [ - ["delimiter", "{{"], - ["punctuation", ":"], - ["variable", "slot-name"], - ["delimiter", "}}"] - ]] + ["handlebars", [ + ["delimiter", "{{"], + ["punctuation", "~"], + ["block", "#if"], + ["variable", "isActive"], + ["punctuation", "~"], + ["delimiter", "}}"] + ]], + ["handlebars", [ + ["delimiter", "{{"], + ["punctuation", "~"], + ["block", "/if"], + ["punctuation", "~"], + ["delimiter", "}}"] + ]], + ["handlebars", [ + ["delimiter", "{{"], + ["punctuation", ":"], + ["variable", "slot-name"], + ["delimiter", "}}"] + ]] ] ---------------------------------------------------- diff --git a/tests/languages/handlebars/variable_feature.test b/tests/languages/handlebars/variable_feature.test index c4de8f427d..31f94da80c 100644 --- a/tests/languages/handlebars/variable_feature.test +++ b/tests/languages/handlebars/variable_feature.test @@ -5,9 +5,15 @@ ---------------------------------------------------- [ - ["handlebars",[["delimiter","{{"],["variable","comments"],["delimiter","}}"]]], - ["handlebars",[["delimiter","{{"],["punctuation","@"],["variable","comments"],["delimiter","}}"]]], - ["handlebars",[["delimiter","{{"],["variable","this"],["punctuation","."],["variable","comments"],["delimiter","}}"]]] + ["handlebars",[ + ["delimiter","{{"],["variable","comments"],["delimiter","}}"]] + ], + ["handlebars",[ + ["delimiter","{{"],["punctuation","@"],["variable","comments"],["delimiter","}}"]] + ], + ["handlebars",[ + ["delimiter","{{"],["variable","this"],["punctuation","."],["variable","comments"],["delimiter","}}"]] + ] ] ----------------------------------------------------