@@ -1221,27 +1221,29 @@ describe('Unit: Stage 2 (AST)', () => {
1221
1221
} ) ;
1222
1222
1223
1223
it ( `should parse doc tags` , ( ) => {
1224
- ast = toLiquidAST ( `{% doc %} asdf {% enddoc %}` ) ;
1224
+ ast = toLiquidAST ( `{% doc %}{% enddoc %}` ) ;
1225
1225
expectPath ( ast , 'children.0.type' ) . to . eql ( 'LiquidRawTag' ) ;
1226
1226
expectPath ( ast , 'children.0.name' ) . to . eql ( 'doc' ) ;
1227
- expectPath ( ast , 'children.0.body.value' ) . to . eql ( ' asdf ' ) ;
1228
- expectPath ( ast , 'children.0.body.type' ) . toEqual ( 'TextNode' ) ;
1227
+ expectPath ( ast , 'children.0.body.value' ) . to . eql ( '' ) ;
1228
+ expectPath ( ast , 'children.0.body.type' ) . toEqual ( 'RawMarkup' ) ;
1229
+ expectPath ( ast , 'children.0.body.nodes' ) . toEqual ( [ ] ) ;
1229
1230
1230
1231
ast = toLiquidAST ( `{% doc -%} single line doc {%- enddoc %}` ) ;
1231
1232
expectPath ( ast , 'children.0.type' ) . to . eql ( 'LiquidRawTag' ) ;
1232
1233
expectPath ( ast , 'children.0.name' ) . to . eql ( 'doc' ) ;
1233
1234
expectPath ( ast , 'children.0.body.value' ) . to . eql ( ' single line doc ' ) ;
1234
- expectPath ( ast , 'children.0.body.type' ) . toEqual ( 'TextNode' ) ;
1235
+ expectPath ( ast , 'children.0.body.nodes.0. type' ) . toEqual ( 'TextNode' ) ;
1235
1236
1236
1237
ast = toLiquidAST ( `{% doc -%}
1237
1238
multi line doc
1238
1239
multi line doc
1239
1240
{%- enddoc %}` ) ;
1240
1241
expectPath ( ast , 'children.0.type' ) . to . eql ( 'LiquidRawTag' ) ;
1241
1242
expectPath ( ast , 'children.0.name' ) . to . eql ( 'doc' ) ;
1242
- expectPath ( ast , 'children.0.body.source ' ) . to . eql (
1243
- '{% doc -%}\n multi line doc\n multi line doc\n {%- enddoc %}' ,
1243
+ expectPath ( ast , 'children.0.body.nodes.0.value ' ) . to . eql (
1244
+ ` multi line doc\n multi line doc` ,
1244
1245
) ;
1246
+ expectPath ( ast , 'children.0.body.nodes.0.type' ) . toEqual ( 'TextNode' ) ;
1245
1247
} ) ;
1246
1248
1247
1249
it ( 'should parse unclosed tables with assignments' , ( ) => {
0 commit comments