diff --git a/README.md b/README.md index 6e0d5992..6d9c604a 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ For example: "parserOptions": { "vueFeatures": { "filter": true, - "interpolationAsNonHTML": false, + "interpolationAsNonHTML": true, "styleCSSVariableInjection": true, } } @@ -165,7 +165,7 @@ However, the following template that are valid in Vue 2 cannot be parsed. ### parserOptions.vueFeatures.interpolationAsNonHTML -You can use `parserOptions.vueFeatures.interpolationAsNonHTML` property to specify whether to parse the interpolation as HTML. If you specify `true`, the parser handles the interpolation as non-HTML (However, you can use HTML escaping in the interpolation). +You can use `parserOptions.vueFeatures.interpolationAsNonHTML` property to specify whether to parse the interpolation as HTML. If you specify `true`, the parser handles the interpolation as non-HTML (However, you can use HTML escaping in the interpolation). Default is `true`. For example: ```json diff --git a/src/common/parser-options.ts b/src/common/parser-options.ts index fd88e645..3000bd76 100644 --- a/src/common/parser-options.ts +++ b/src/common/parser-options.ts @@ -6,7 +6,7 @@ export interface ParserOptions { // vue-eslint-parser options parser?: boolean | string vueFeatures?: { - interpolationAsNonHTML?: boolean // default false + interpolationAsNonHTML?: boolean // default true filter?: boolean // default true styleCSSVariableInjection?: boolean // default true } diff --git a/src/html/tokenizer.ts b/src/html/tokenizer.ts index 5d83610f..3357a14e 100644 --- a/src/html/tokenizer.ts +++ b/src/html/tokenizer.ts @@ -1852,7 +1852,12 @@ export class Tokenizer { this.appendTokenValue(LEFT_CURLY_BRACKET, null) this.appendTokenValue(LEFT_CURLY_BRACKET, null) - if (!this.parserOptions.vueFeatures?.interpolationAsNonHTML) { + if ( + !( + this.parserOptions.vueFeatures?.interpolationAsNonHTML ?? + true + ) + ) { return this.returnState } diff --git a/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/ast.json b/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/ast.json new file mode 100644 index 00000000..5f07b6d3 --- /dev/null +++ b/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/ast.json @@ -0,0 +1,650 @@ +{ + "type": "Program", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "range": [ + 0, + 0 + ], + "body": [], + "sourceType": "script", + "comments": [], + "tokens": [], + "templateBody": { + "type": "VElement", + "range": [ + 0, + 67 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "name": "template", + "rawName": "template", + "namespace": "http://www.w3.org/1999/xhtml", + "startTag": { + "type": "VStartTag", + "range": [ + 0, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "selfClosing": false, + "attributes": [] + }, + "children": [ + { + "type": "VText", + "range": [ + 10, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "value": "\n {{a" + }, + { + "type": "VElement", + "range": [ + 18, + 56 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 5, + "column": 0 + } + }, + "name": "b}}", + "rawName": "b}}", + "namespace": "http://www.w3.org/1999/xhtml", + "startTag": { + "type": "VStartTag", + "range": [ + 18, + 35 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "selfClosing": false, + "attributes": [ + { + "type": "VAttribute", + "range": [ + 27, + 34 + ], + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "directive": false, + "key": { + "type": "VIdentifier", + "range": [ + 27, + 34 + ], + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "name": "{{a + {{ab}} + {{ab}} + diff --git a/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/token-ranges.json b/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/token-ranges.json new file mode 100644 index 00000000..7013bd5f --- /dev/null +++ b/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/token-ranges.json @@ -0,0 +1,23 @@ +[ + "", + "\n ", + "{{", + "a", + "", + "b", + "}}", + "\n ", + "{{", + "a", + "", + "b", + "}}", + "\n", + "", + "\n" +] \ No newline at end of file diff --git a/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/tree.json b/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/tree.json new file mode 100644 index 00000000..259a0467 --- /dev/null +++ b/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/tree.json @@ -0,0 +1,67 @@ +[ + { + "type": "VElement", + "text": "", + "children": [ + { + "type": "VStartTag", + "text": "", + "children": [] + } + ] + } +] \ No newline at end of file diff --git a/test/fixtures/ast/mustache-in-lt-gt/ast.json b/test/fixtures/ast/mustache-in-lt-gt/ast.json index 5f07b6d3..d039a691 100644 --- a/test/fixtures/ast/mustache-in-lt-gt/ast.json +++ b/test/fixtures/ast/mustache-in-lt-gt/ast.json @@ -63,7 +63,7 @@ "type": "VText", "range": [ 10, - 18 + 15 ], "loc": { "start": { @@ -72,171 +72,669 @@ }, "end": { "line": 2, - "column": 7 + "column": 4 } }, - "value": "\n {{a" + "value": "\n " }, { - "type": "VElement", + "type": "VExpressionContainer", "range": [ - 18, - 56 + 15, + 22 ], "loc": { "start": { "line": 2, - "column": 7 + "column": 4 }, "end": { - "line": 5, - "column": 0 + "line": 2, + "column": 11 } }, - "name": "b}}", - "rawName": "b}}", - "namespace": "http://www.w3.org/1999/xhtml", - "startTag": { - "type": "VStartTag", + "expression": { + "type": "BinaryExpression", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 9 + } + }, "range": [ - 18, - 35 + 17, + 20 ], + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 17, + 18 + ], + "name": "a" + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 19, + 20 + ], + "name": "b" + } + }, + "references": [ + { + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 17, + 18 + ], + "name": "a" + }, + "mode": "r" + }, + { + "id": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 19, + 20 + ], + "name": "b" + }, + "mode": "r" + } + ] + }, + { + "type": "VText", + "range": [ + 22, + 27 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "value": "\n " + }, + { + "type": "VExpressionContainer", + "range": [ + 27, + 38 + ], + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 29, + "end": 36, "loc": { "start": { - "line": 2, - "column": 7 + "line": 3, + "column": 6 }, "end": { "line": 3, - "column": 12 + "column": 13 } }, - "selfClosing": false, - "attributes": [ - { - "type": "VAttribute", + "range": [ + 29, + 36 + ], + "left": { + "type": "BinaryExpression", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 29, + 32 + ], + "left": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, "range": [ - 27, - 34 + 29, + 30 + ], + "name": "a" + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 31, + 32 ], + "name": "b" + } + }, + "operator": "&", + "right": { + "type": "BinaryExpression", + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 33, + 36 + ], + "left": { + "type": "Identifier", + "start": 33, + "end": 34, "loc": { "start": { "line": 3, - "column": 4 + "column": 10 }, "end": { "line": 3, "column": 11 } }, - "directive": false, - "key": { - "type": "VIdentifier", - "range": [ - 27, - 34 - ], - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 11 - } + "range": [ + 33, + 34 + ], + "name": "a" + }, + "operator": ">", + "right": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 12 }, - "name": "{{a", + "right": { + "type": "Identifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 52, + 53 + ], + "name": "b" + } + } + }, + "references": [ + { + "id": { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } }, - "end": { - "line": 4, - "column": 7 - } + "range": [ + 45, + 46 + ], + "name": "a" }, - "value": "b}}\n {{a" + "mode": "r" }, { - "type": "VElement", - "range": [ - 46, - 56 - ], - "loc": { - "start": { - "line": 4, - "column": 7 + "id": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } }, - "end": { - "line": 5, - "column": 0 - } - }, - "name": "b&12", - "rawName": "b&12", - "namespace": "http://www.w3.org/1999/xhtml", - "startTag": { - "type": "VStartTag", "range": [ - 46, - 52 + 47, + 48 ], + "name": "b" + }, + "mode": "r" + }, + { + "id": { + "type": "Identifier", + "start": 52, + "end": 53, "loc": { "start": { "line": 4, - "column": 7 + "column": 13 }, "end": { "line": 4, - "column": 13 + "column": 14 } }, - "selfClosing": false, - "attributes": [] + "range": [ + 52, + 53 + ], + "name": "b" }, - "children": [ - { - "type": "VText", - "range": [ - 52, - 56 - ], - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 5, - "column": 0 - } - }, - "value": "b}}\n" - } - ], - "endTag": null, - "variables": [] + "mode": "r" } + ] + }, + { + "type": "VText", + "range": [ + 55, + 56 ], - "endTag": null, - "variables": [] + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 5, + "column": 0 + } + }, + "value": "\n" } ], "endTag": { @@ -331,11 +829,10 @@ "value": "{{" }, { - "type": "HTMLText", - "range": [ - 17, - 18 - ], + "type": "Identifier", + "value": "a", + "start": 17, + "end": 18, "loc": { "start": { "line": 2, @@ -346,31 +843,92 @@ "column": 7 } }, - "value": "a" + "range": [ + 17, + 18 + ] }, { - "type": "HTMLTagOpen", + "type": "Punctuator", + "value": "<", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, "range": [ 18, + 19 + ] + }, + { + "type": "Identifier", + "value": "b", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 19, + 20 + ] + }, + { + "type": "VExpressionEnd", + "range": [ + 20, 22 ], "loc": { "start": { "line": 2, - "column": 7 + "column": 9 }, "end": { "line": 2, "column": 11 } }, - "value": "b}}" + "value": "}}" + }, + { + "type": "HTMLWhitespace", + "range": [ + 22, + 27 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "value": "\n " }, { - "type": "HTMLIdentifier", + "type": "VExpressionStart", "range": [ 27, - 34 + 29 ], "loc": { "start": { @@ -379,17 +937,116 @@ }, "end": { "line": 3, - "column": 11 + "column": 6 } }, - "value": "{{a", + "start": 34, + "end": 35, "loc": { "start": { "line": 3, @@ -400,14 +1057,16 @@ "column": 12 } }, - "value": "" + "range": [ + 34, + 35 + ] }, { - "type": "HTMLText", - "range": [ - 35, - 36 - ], + "type": "Identifier", + "value": "b", + "start": 35, + "end": 36, "loc": { "start": { "line": 3, @@ -418,7 +1077,10 @@ "column": 13 } }, - "value": "b" + "range": [ + 35, + 36 + ] }, { "type": "VExpressionEnd", @@ -475,11 +1137,10 @@ "value": "{{" }, { - "type": "HTMLText", - "range": [ - 45, - 46 - ], + "type": "Identifier", + "value": "a", + "start": 45, + "end": 46, "loc": { "start": { "line": 4, @@ -490,32 +1151,96 @@ "column": 7 } }, - "value": "a" + "range": [ + 45, + 46 + ] }, { - "type": "HTMLTagOpen", + "type": "Punctuator", + "value": "<", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 8 + } + }, "range": [ 46, - 51 - ], + 47 + ] + }, + { + "type": "Identifier", + "value": "b", + "start": 47, + "end": 48, "loc": { "start": { "line": 4, - "column": 7 + "column": 8 }, "end": { "line": 4, - "column": 12 + "column": 9 } }, - "value": "b&12" + "range": [ + 47, + 48 + ] }, { - "type": "HTMLTagClose", + "type": "Punctuator", + "value": "&", + "start": 48, + "end": 49, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, "range": [ - 51, - 52 - ], + 48, + 49 + ] + }, + { + "type": "Numeric", + "value": "12", + "start": 49, + "end": 51, + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 49, + 51 + ] + }, + { + "type": "Punctuator", + "value": ">", + "start": 51, + "end": 52, "loc": { "start": { "line": 4, @@ -526,14 +1251,16 @@ "column": 13 } }, - "value": "" + "range": [ + 51, + 52 + ] }, { - "type": "HTMLText", - "range": [ - 52, - 53 - ], + "type": "Identifier", + "value": "b", + "start": 52, + "end": 53, "loc": { "start": { "line": 4, @@ -544,7 +1271,10 @@ "column": 14 } }, - "value": "b" + "range": [ + 52, + 53 + ] }, { "type": "VExpressionEnd", @@ -638,13 +1368,6 @@ } ], "comments": [], - "errors": [ - { - "message": "unexpected-character-in-attribute-name", - "index": 30, - "lineNumber": 3, - "column": 7 - } - ] + "errors": [] } } \ No newline at end of file diff --git a/test/fixtures/ast/mustache-in-lt-gt/token-ranges.json b/test/fixtures/ast/mustache-in-lt-gt/token-ranges.json index 7013bd5f..d7d89c9a 100644 --- a/test/fixtures/ast/mustache-in-lt-gt/token-ranges.json +++ b/test/fixtures/ast/mustache-in-lt-gt/token-ranges.json @@ -4,15 +4,26 @@ "\n ", "{{", "a", - "", "b", "}}", "\n ", "{{", "a", - "", "b", "}}", diff --git a/test/fixtures/ast/mustache-in-lt-gt/tree.json b/test/fixtures/ast/mustache-in-lt-gt/tree.json index 259a0467..daaedefc 100644 --- a/test/fixtures/ast/mustache-in-lt-gt/tree.json +++ b/test/fixtures/ast/mustache-in-lt-gt/tree.json @@ -10,53 +10,134 @@ }, { "type": "VText", - "text": "\n {{a", + "text": "\n ", "children": [] }, { - "type": "VElement", - "text": "b}}\n {{ab}}\n", + "type": "VExpressionContainer", + "text": "{{a", + "type": "BinaryExpression", + "text": "ab}}", + "children": [ + { + "type": "BinaryExpression", + "text": "ab", + "children": [ + { + "type": "BinaryExpression", + "text": "ab", + "children": [ + { + "type": "Identifier", + "text": "a", + "children": [] + }, + { + "type": "Identifier", + "text": "b", "children": [] } ] } ] - }, - { - "type": "VText", - "text": "b}}\n {{a", - "children": [] - }, + } + ] + }, + { + "type": "VText", + "text": "\n ", + "children": [] + }, + { + "type": "VExpressionContainer", + "text": "{{ab}}", + "children": [ { - "type": "VElement", - "text": "b}}\n", + "type": "BinaryExpression", + "text": "ab", "children": [ { - "type": "VStartTag", - "text": "", - "children": [] + "type": "BinaryExpression", + "text": "ab", + "children": [ + { + "type": "Literal", + "text": "12", + "children": [] + }, + { + "type": "Identifier", + "text": "b", + "children": [] + } + ] } ] } ] }, + { + "type": "VText", + "text": "\n", + "children": [] + }, { "type": "VEndTag", "text": "", diff --git a/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/ast.json b/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/ast.json new file mode 100644 index 00000000..7b15f10c --- /dev/null +++ b/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/ast.json @@ -0,0 +1,1139 @@ +{ + "type": "Program", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "range": [ + 0, + 0 + ], + "body": [], + "sourceType": "script", + "comments": [], + "tokens": [], + "templateBody": { + "type": "VElement", + "range": [ + 0, + 133 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 11 + } + }, + "name": "template", + "rawName": "template", + "namespace": "http://www.w3.org/1999/xhtml", + "startTag": { + "type": "VStartTag", + "range": [ + 0, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "selfClosing": false, + "attributes": [] + }, + "children": [ + { + "type": "VText", + "range": [ + 10, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "value": "\n {{a" + }, + { + "type": "VElement", + "range": [ + 18, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "name": "br", + "rawName": "br", + "namespace": "http://www.w3.org/1999/xhtml", + "startTag": { + "type": "VStartTag", + "range": [ + 18, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "selfClosing": false, + "attributes": [] + }, + "children": [], + "endTag": null, + "variables": [] + }, + { + "type": "VText", + "range": [ + 22, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "value": "}}\n {{b" + }, + { + "type": "VText", + "range": [ + 46, + 56 + ], + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "value": "}}\n {{c" + }, + { + "type": "VText", + "range": [ + 59, + 68 + ], + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "value": "}}\n {{" + }, + { + "type": "VText", + "range": [ + 71, + 81 + ], + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "value": "d}}\n {{" + }, + { + "type": "VText", + "range": [ + 84, + 91 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 7, + "column": 4 + } + }, + "value": "}}\n " + }, + { + "type": "VElement", + "range": [ + 91, + 95 + ], + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "name": "br", + "rawName": "br", + "namespace": "http://www.w3.org/1999/xhtml", + "startTag": { + "type": "VStartTag", + "range": [ + 91, + 95 + ], + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "selfClosing": false, + "attributes": [] + }, + "children": [], + "endTag": null, + "variables": [] + }, + { + "type": "VText", + "range": [ + 95, + 97 + ], + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "value": "{{" + }, + { + "type": "VElement", + "range": [ + 97, + 101 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "name": "br", + "rawName": "br", + "namespace": "http://www.w3.org/1999/xhtml", + "startTag": { + "type": "VStartTag", + "range": [ + 97, + 101 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "selfClosing": false, + "attributes": [] + }, + "children": [], + "endTag": null, + "variables": [] + }, + { + "type": "VText", + "range": [ + 101, + 106 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 8, + "column": 4 + } + }, + "value": "\n " + }, + { + "type": "VExpressionContainer", + "range": [ + 106, + 119 + ], + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "expression": null, + "references": [] + }, + { + "type": "VText", + "range": [ + 119, + 122 + ], + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 9, + "column": 0 + } + }, + "value": "}}\n" + } + ], + "endTag": { + "type": "VEndTag", + "range": [ + 122, + 133 + ], + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 11 + } + } + }, + "variables": [], + "tokens": [ + { + "type": "HTMLTagOpen", + "range": [ + 0, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": "template" + }, + { + "type": "HTMLTagClose", + "range": [ + 9, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": "" + }, + { + "type": "HTMLWhitespace", + "range": [ + 10, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "value": "\n " + }, + { + "type": "VExpressionStart", + "range": [ + 15, + 17 + ], + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "value": "{{" + }, + { + "type": "HTMLText", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "value": "a" + }, + { + "type": "HTMLTagOpen", + "range": [ + 18, + 21 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "value": "br" + }, + { + "type": "HTMLTagClose", + "range": [ + 21, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "value": "" + }, + { + "type": "VExpressionEnd", + "range": [ + 22, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "value": "}}" + }, + { + "type": "HTMLWhitespace", + "range": [ + 24, + 29 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "value": "\n " + }, + { + "type": "VExpressionStart", + "range": [ + 29, + 31 + ], + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "value": "{{" + }, + { + "type": "HTMLText", + "range": [ + 31, + 32 + ], + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "value": "b" + }, + { + "type": "VExpressionEnd", + "range": [ + 46, + 48 + ], + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "value": "}}" + }, + { + "type": "HTMLWhitespace", + "range": [ + 48, + 53 + ], + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "value": "\n " + }, + { + "type": "VExpressionStart", + "range": [ + 53, + 55 + ], + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "value": "{{" + }, + { + "type": "HTMLText", + "range": [ + 55, + 56 + ], + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "value": "c" + }, + { + "type": "VExpressionEnd", + "range": [ + 59, + 61 + ], + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "value": "}}" + }, + { + "type": "HTMLWhitespace", + "range": [ + 61, + 66 + ], + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 5, + "column": 4 + } + }, + "value": "\n " + }, + { + "type": "VExpressionStart", + "range": [ + 66, + 68 + ], + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "value": "{{" + }, + { + "type": "HTMLText", + "range": [ + 71, + 72 + ], + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "value": "d" + }, + { + "type": "VExpressionEnd", + "range": [ + 72, + 74 + ], + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "value": "}}" + }, + { + "type": "HTMLWhitespace", + "range": [ + 74, + 79 + ], + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 6, + "column": 4 + } + }, + "value": "\n " + }, + { + "type": "VExpressionStart", + "range": [ + 79, + 81 + ], + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "value": "{{" + }, + { + "type": "VExpressionEnd", + "range": [ + 84, + 86 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 11 + } + }, + "value": "}}" + }, + { + "type": "HTMLWhitespace", + "range": [ + 86, + 91 + ], + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 7, + "column": 4 + } + }, + "value": "\n " + }, + { + "type": "HTMLTagOpen", + "range": [ + 91, + 94 + ], + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "value": "br" + }, + { + "type": "HTMLTagClose", + "range": [ + 94, + 95 + ], + "loc": { + "start": { + "line": 7, + "column": 7 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "value": "" + }, + { + "type": "VExpressionStart", + "range": [ + 95, + 97 + ], + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "value": "{{" + }, + { + "type": "HTMLTagOpen", + "range": [ + 97, + 100 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 13 + } + }, + "value": "br" + }, + { + "type": "HTMLTagClose", + "range": [ + 100, + 101 + ], + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "value": "" + }, + { + "type": "HTMLWhitespace", + "range": [ + 101, + 106 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 8, + "column": 4 + } + }, + "value": "\n " + }, + { + "type": "VExpressionStart", + "range": [ + 106, + 108 + ], + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "value": "{{" + }, + { + "type": "VExpressionStart", + "range": [ + 108, + 110 + ], + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "value": "{{" + }, + { + "type": "HTMLText", + "range": [ + 110, + 117 + ], + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "value": "invalid" + }, + { + "type": "VExpressionEnd", + "range": [ + 117, + 119 + ], + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "value": "}}" + }, + { + "type": "VExpressionEnd", + "range": [ + 119, + 121 + ], + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 19 + } + }, + "value": "}}" + }, + { + "type": "HTMLWhitespace", + "range": [ + 121, + 122 + ], + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 9, + "column": 0 + } + }, + "value": "\n" + }, + { + "type": "HTMLEndTagOpen", + "range": [ + 122, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "value": "template" + }, + { + "type": "HTMLTagClose", + "range": [ + 132, + 133 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 11 + } + }, + "value": "" + }, + { + "type": "HTMLWhitespace", + "range": [ + 133, + 134 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 10, + "column": 0 + } + }, + "value": "\n" + } + ], + "comments": [ + { + "type": "HTMLComment", + "range": [ + 32, + 46 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "value": "comment" + } + ], + "errors": [ + { + "message": "missing-end-tag-name", + "index": 58, + "lineNumber": 4, + "column": 9 + }, + { + "message": "missing-end-tag-name", + "index": 70, + "lineNumber": 5, + "column": 8 + }, + { + "message": "missing-end-tag-name", + "index": 83, + "lineNumber": 6, + "column": 8 + }, + { + "message": "Unexpected token {", + "index": 109, + "lineNumber": 8, + "column": 7 + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/parser-options.json b/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/parser-options.json new file mode 100644 index 00000000..20b845f2 --- /dev/null +++ b/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/parser-options.json @@ -0,0 +1,5 @@ +{ + "vueFeatures": { + "interpolationAsNonHTML": false + } +} diff --git a/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/source.vue b/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/source.vue new file mode 100644 index 00000000..c8b308a5 --- /dev/null +++ b/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/source.vue @@ -0,0 +1,9 @@ + diff --git a/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/token-ranges.json b/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/token-ranges.json new file mode 100644 index 00000000..03799f9c --- /dev/null +++ b/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/token-ranges.json @@ -0,0 +1,42 @@ +[ + "", + "\n ", + "{{", + "a", + "", + "}}", + "\n ", + "{{", + "b", + "}}", + "\n ", + "{{", + "c", + "}}", + "\n ", + "{{", + "d", + "}}", + "\n ", + "{{", + "}}", + "\n ", + "", + "{{", + "", + "\n ", + "{{", + "{{", + "invalid", + "}}", + "}}", + "\n", + "", + "\n", + "" +] \ No newline at end of file diff --git a/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/tree.json b/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/tree.json new file mode 100644 index 00000000..4ea9bf97 --- /dev/null +++ b/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/tree.json @@ -0,0 +1,101 @@ +[ + { + "type": "VElement", + "text": "", + "children": [ + { + "type": "VStartTag", + "text": "", + "children": [] + } + ] + } +] \ No newline at end of file diff --git a/test/fixtures/ast/mustache-not-closed/ast.json b/test/fixtures/ast/mustache-not-closed/ast.json index 7b15f10c..4f81aa1b 100644 --- a/test/fixtures/ast/mustache-not-closed/ast.json +++ b/test/fixtures/ast/mustache-not-closed/ast.json @@ -63,7 +63,7 @@ "type": "VText", "range": [ 10, - 18 + 15 ], "loc": { "start": { @@ -72,217 +72,210 @@ }, "end": { "line": 2, - "column": 7 + "column": 4 } }, - "value": "\n {{a" + "value": "\n " }, { - "type": "VElement", + "type": "VExpressionContainer", "range": [ - 18, - 22 + 15, + 24 ], "loc": { "start": { "line": 2, - "column": 7 + "column": 4 }, "end": { "line": 2, - "column": 11 + "column": 13 } }, - "name": "br", - "rawName": "br", - "namespace": "http://www.w3.org/1999/xhtml", - "startTag": { - "type": "VStartTag", - "range": [ - 18, - 22 - ], - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 11 - } - }, - "selfClosing": false, - "attributes": [] - }, - "children": [], - "endTag": null, - "variables": [] + "expression": null, + "references": [] }, { "type": "VText", "range": [ - 22, - 32 + 24, + 29 ], "loc": { "start": { "line": 2, - "column": 11 + "column": 13 }, "end": { "line": 3, - "column": 7 + "column": 4 + } + }, + "value": "\n " + }, + { + "type": "VExpressionContainer", + "range": [ + 29, + 48 + ], + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 23 } }, - "value": "}}\n {{b" + "expression": null, + "references": [] }, { "type": "VText", "range": [ - 46, - 56 + 48, + 53 ], "loc": { "start": { "line": 3, - "column": 21 + "column": 23 }, "end": { "line": 4, - "column": 7 + "column": 4 } }, - "value": "}}\n {{c" + "value": "\n " + }, + { + "type": "VExpressionContainer", + "range": [ + 53, + 61 + ], + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "expression": null, + "references": [] }, { "type": "VText", "range": [ - 59, - 68 + 61, + 66 ], "loc": { "start": { "line": 4, - "column": 10 + "column": 12 }, "end": { "line": 5, - "column": 6 + "column": 4 } }, - "value": "}}\n {{" + "value": "\n " }, { - "type": "VText", + "type": "VExpressionContainer", "range": [ - 71, - 81 + 66, + 74 ], "loc": { "start": { "line": 5, - "column": 9 + "column": 4 }, "end": { - "line": 6, - "column": 6 + "line": 5, + "column": 12 } }, - "value": "d}}\n {{" + "expression": null, + "references": [] }, { "type": "VText", "range": [ - 84, - 91 + 74, + 79 ], "loc": { "start": { - "line": 6, - "column": 9 + "line": 5, + "column": 12 }, "end": { - "line": 7, + "line": 6, "column": 4 } }, - "value": "}}\n " + "value": "\n " }, { - "type": "VElement", + "type": "VExpressionContainer", "range": [ - 91, - 95 + 79, + 86 ], "loc": { "start": { - "line": 7, + "line": 6, "column": 4 }, "end": { - "line": 7, - "column": 8 + "line": 6, + "column": 11 } }, - "name": "br", - "rawName": "br", - "namespace": "http://www.w3.org/1999/xhtml", - "startTag": { - "type": "VStartTag", - "range": [ - 91, - 95 - ], - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 8 - } - }, - "selfClosing": false, - "attributes": [] - }, - "children": [], - "endTag": null, - "variables": [] + "expression": null, + "references": [] }, { "type": "VText", "range": [ - 95, - 97 + 86, + 91 ], "loc": { "start": { - "line": 7, - "column": 8 + "line": 6, + "column": 11 }, "end": { "line": 7, - "column": 10 + "column": 4 } }, - "value": "{{" + "value": "\n " }, { "type": "VElement", "range": [ - 97, - 101 + 91, + 95 ], "loc": { "start": { "line": 7, - "column": 10 + "column": 4 }, "end": { "line": 7, - "column": 14 + "column": 8 } }, "name": "br", @@ -291,17 +284,17 @@ "startTag": { "type": "VStartTag", "range": [ - 97, - 101 + 91, + 95 ], "loc": { "start": { "line": 7, - "column": 10 + "column": 4 }, "end": { "line": 7, - "column": 14 + "column": 8 } }, "selfClosing": false, @@ -311,34 +304,16 @@ "endTag": null, "variables": [] }, - { - "type": "VText", - "range": [ - 101, - 106 - ], - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 8, - "column": 4 - } - }, - "value": "\n " - }, { "type": "VExpressionContainer", "range": [ - 106, + 95, 119 ], "loc": { "start": { - "line": 8, - "column": 4 + "line": 7, + "column": 8 }, "end": { "line": 8, @@ -462,55 +437,19 @@ "type": "HTMLText", "range": [ 17, - 18 - ], - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "value": "a" - }, - { - "type": "HTMLTagOpen", - "range": [ - 18, - 21 - ], - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 10 - } - }, - "value": "br" - }, - { - "type": "HTMLTagClose", - "range": [ - 21, 22 ], "loc": { "start": { "line": 2, - "column": 10 + "column": 6 }, "end": { "line": 2, "column": 11 } }, - "value": "" + "value": "a
" }, { "type": "VExpressionEnd", @@ -570,7 +509,7 @@ "type": "HTMLText", "range": [ 31, - 32 + 46 ], "loc": { "start": { @@ -579,10 +518,10 @@ }, "end": { "line": 3, - "column": 7 + "column": 21 } }, - "value": "b" + "value": "b" }, { "type": "VExpressionEnd", @@ -642,7 +581,7 @@ "type": "HTMLText", "range": [ 55, - 56 + 59 ], "loc": { "start": { @@ -651,10 +590,10 @@ }, "end": { "line": 4, - "column": 7 + "column": 10 } }, - "value": "c" + "value": "c" }, { "type": "VExpressionEnd", @@ -713,20 +652,20 @@ { "type": "HTMLText", "range": [ - 71, + 68, 72 ], "loc": { "start": { "line": 5, - "column": 9 + "column": 6 }, "end": { "line": 5, "column": 10 } }, - "value": "d" + "value": "d" }, { "type": "VExpressionEnd", @@ -782,6 +721,24 @@ }, "value": "{{" }, + { + "type": "HTMLText", + "range": [ + 81, + 84 + ], + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "value": "" + }, { "type": "VExpressionEnd", "range": [ @@ -873,40 +830,22 @@ "value": "{{" }, { - "type": "HTMLTagOpen", + "type": "HTMLText", "range": [ 97, - 100 - ], - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 13 - } - }, - "value": "br" - }, - { - "type": "HTMLTagClose", - "range": [ - 100, 101 ], "loc": { "start": { "line": 7, - "column": 13 + "column": 10 }, "end": { "line": 7, "column": 14 } }, - "value": "" + "value": "
" }, { "type": "HTMLWhitespace", @@ -926,59 +865,23 @@ }, "value": "\n " }, - { - "type": "VExpressionStart", - "range": [ - 106, - 108 - ], - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 6 - } - }, - "value": "{{" - }, - { - "type": "VExpressionStart", - "range": [ - 108, - 110 - ], - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 8 - } - }, - "value": "{{" - }, { "type": "HTMLText", "range": [ - 110, + 106, 117 ], "loc": { "start": { "line": 8, - "column": 8 + "column": 4 }, "end": { "line": 8, "column": 15 } }, - "value": "invalid" + "value": "{{{{invalid" }, { "type": "VExpressionEnd", @@ -1089,50 +992,43 @@ "value": "\n" } ], - "comments": [ - { - "type": "HTMLComment", - "range": [ - 32, - 46 - ], - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 21 - } - }, - "value": "comment" - } - ], + "comments": [], "errors": [ { - "message": "missing-end-tag-name", + "message": "Unexpected end of expression.", + "index": 22, + "lineNumber": 2, + "column": 11 + }, + { + "message": "Unexpected end of expression.", + "index": 47, + "lineNumber": 3, + "column": 22 + }, + { + "message": "Unterminated regular expression", "index": 58, "lineNumber": 4, "column": 9 }, { - "message": "missing-end-tag-name", - "index": 70, + "message": "Unexpected token <", + "index": 68, "lineNumber": 5, - "column": 8 + "column": 6 }, { - "message": "missing-end-tag-name", - "index": 83, + "message": "Unexpected token <", + "index": 81, "lineNumber": 6, - "column": 8 + "column": 6 }, { - "message": "Unexpected token {", - "index": 109, - "lineNumber": 8, - "column": 7 + "message": "Unexpected token <", + "index": 97, + "lineNumber": 7, + "column": 10 } ] } diff --git a/test/fixtures/ast/mustache-not-closed/token-ranges.json b/test/fixtures/ast/mustache-not-closed/token-ranges.json index 03799f9c..a2618a5c 100644 --- a/test/fixtures/ast/mustache-not-closed/token-ranges.json +++ b/test/fixtures/ast/mustache-not-closed/token-ranges.json @@ -3,40 +3,35 @@ ">", "\n ", "{{", - "a", - "", + "a
", "}}", "\n ", "{{", - "b", + "b", "}}", "\n ", "{{", - "c", + "c", "}}", "\n ", "{{", - "d", + "d", "}}", "\n ", "{{", + "", "}}", "\n ", "", "{{", - "", + "
", "\n ", - "{{", - "{{", - "invalid", + "{{{{invalid", "}}", "}}", "\n", "", - "\n", - "" + "\n" ] \ No newline at end of file diff --git a/test/fixtures/ast/mustache-not-closed/tree.json b/test/fixtures/ast/mustache-not-closed/tree.json index 4ea9bf97..ee50070a 100644 --- a/test/fixtures/ast/mustache-not-closed/tree.json +++ b/test/fixtures/ast/mustache-not-closed/tree.json @@ -10,59 +10,57 @@ }, { "type": "VText", - "text": "\n {{a", + "text": "\n ", "children": [] }, { - "type": "VElement", - "text": "
", - "children": [ - { - "type": "VStartTag", - "text": "
", - "children": [] - } - ] + "type": "VExpressionContainer", + "text": "{{a
}}", + "children": [] }, { "type": "VText", - "text": "}}\n {{b", + "text": "\n ", "children": [] }, { - "type": "VText", - "text": "}}\n {{c", + "type": "VExpressionContainer", + "text": "{{b}}", "children": [] }, { "type": "VText", - "text": "}}\n {{", + "text": "\n ", + "children": [] + }, + { + "type": "VExpressionContainer", + "text": "{{c}}", "children": [] }, { "type": "VText", - "text": "d}}\n {{", + "text": "\n ", + "children": [] + }, + { + "type": "VExpressionContainer", + "text": "{{d}}", "children": [] }, { "type": "VText", - "text": "}}\n ", + "text": "\n ", "children": [] }, { - "type": "VElement", - "text": "
", - "children": [ - { - "type": "VStartTag", - "text": "
", - "children": [] - } - ] + "type": "VExpressionContainer", + "text": "{{}}", + "children": [] }, { "type": "VText", - "text": "{{", + "text": "\n ", "children": [] }, { @@ -76,14 +74,9 @@ } ] }, - { - "type": "VText", - "text": "\n ", - "children": [] - }, { "type": "VExpressionContainer", - "text": "{{{{invalid}}", + "text": "{{
\n {{{{invalid}}", "children": [] }, {