diff --git a/packages/liquid-html-parser/src/stage-2-ast.spec.ts b/packages/liquid-html-parser/src/stage-2-ast.spec.ts index f25b2f6da..d88a557e2 100644 --- a/packages/liquid-html-parser/src/stage-2-ast.spec.ts +++ b/packages/liquid-html-parser/src/stage-2-ast.spec.ts @@ -1221,17 +1221,18 @@ describe('Unit: Stage 2 (AST)', () => { }); it(`should parse doc tags`, () => { - ast = toLiquidAST(`{% doc %} asdf {% enddoc %}`); + ast = toLiquidAST(`{% doc %}{% enddoc %}`); expectPath(ast, 'children.0.type').to.eql('LiquidRawTag'); expectPath(ast, 'children.0.name').to.eql('doc'); - expectPath(ast, 'children.0.body.value').to.eql(' asdf '); - expectPath(ast, 'children.0.body.type').toEqual('TextNode'); + expectPath(ast, 'children.0.body.value').to.eql(''); + expectPath(ast, 'children.0.body.type').toEqual('RawMarkup'); + expectPath(ast, 'children.0.body.nodes').toEqual([]); ast = toLiquidAST(`{% doc -%} single line doc {%- enddoc %}`); expectPath(ast, 'children.0.type').to.eql('LiquidRawTag'); expectPath(ast, 'children.0.name').to.eql('doc'); expectPath(ast, 'children.0.body.value').to.eql(' single line doc '); - expectPath(ast, 'children.0.body.type').toEqual('TextNode'); + expectPath(ast, 'children.0.body.nodes.0.type').toEqual('TextNode'); ast = toLiquidAST(`{% doc -%} multi line doc @@ -1239,9 +1240,10 @@ describe('Unit: Stage 2 (AST)', () => { {%- enddoc %}`); expectPath(ast, 'children.0.type').to.eql('LiquidRawTag'); expectPath(ast, 'children.0.name').to.eql('doc'); - expectPath(ast, 'children.0.body.source').to.eql( - '{% doc -%}\n multi line doc\n multi line doc\n {%- enddoc %}', + expectPath(ast, 'children.0.body.nodes.0.value').to.eql( + `multi line doc\n multi line doc`, ); + expectPath(ast, 'children.0.body.nodes.0.type').toEqual('TextNode'); }); it('should parse unclosed tables with assignments', () => {