File tree 1 file changed +22
-0
lines changed
packages/liquid-html-parser/src
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1220,6 +1220,28 @@ describe('Unit: Stage 2 (AST)', () => {
1220
1220
expectPath ( ast , 'children.0.markup.1.children.0.children.1.markup.name' ) . to . eql ( 'var3' ) ;
1221
1221
} ) ;
1222
1222
1223
+ it ( `should parse doc tags` , ( ) => {
1224
+ ast = toLiquidAST ( `{% doc %}{% enddoc %}` ) ;
1225
+ expectPath ( ast , 'children.0.type' ) . to . eql ( 'LiquidRawTag' ) ;
1226
+ expectPath ( ast , 'children.0.name' ) . to . eql ( 'doc' ) ;
1227
+ expectPath ( ast , 'children.0.body.value' ) . to . eql ( '' ) ;
1228
+
1229
+ ast = toLiquidAST ( `{% doc -%} single line doc {%- enddoc %}` ) ;
1230
+ expectPath ( ast , 'children.0.type' ) . to . eql ( 'LiquidRawTag' ) ;
1231
+ expectPath ( ast , 'children.0.name' ) . to . eql ( 'doc' ) ;
1232
+ expectPath ( ast , 'children.0.body.value' ) . to . eql ( ' single line doc ' ) ;
1233
+
1234
+ ast = toLiquidAST ( `{% doc -%}
1235
+ multi line doc
1236
+ multi line doc
1237
+ {%- enddoc %}` ) ;
1238
+ expectPath ( ast , 'children.0.type' ) . to . eql ( 'LiquidRawTag' ) ;
1239
+ expectPath ( ast , 'children.0.name' ) . to . eql ( 'doc' ) ;
1240
+ expectPath ( ast , 'children.0.body.source' ) . to . eql (
1241
+ '{% doc -%}\n multi line doc\n multi line doc\n {%- enddoc %}' ,
1242
+ ) ;
1243
+ } ) ;
1244
+
1223
1245
it ( 'should parse unclosed tables with assignments' , ( ) => {
1224
1246
ast = toLiquidAST ( `
1225
1247
{%- liquid
You can’t perform that action at this time.
0 commit comments