Skip to content

Commit c2768ee

Browse files
committed
Add 'doc' to TAGS_WITHOUT_MARKUP
reason: doc tag cannot have markup, so we strip it if present in stage 2.
1 parent 2a200e0 commit c2768ee

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/liquid-html-parser/src/grammar.ts

+1
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ export const TAGS_WITHOUT_MARKUP = [
5353
'continue',
5454
'comment',
5555
'raw',
56+
'doc',
5657
];

packages/liquid-html-parser/src/stage-2-ast.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,7 @@ describe('Unit: Stage 2 (AST)', () => {
12241224
ast = toLiquidAST(`{% doc %}{% enddoc %}`);
12251225
expectPath(ast, 'children.0.type').to.eql('LiquidRawTag');
12261226
expectPath(ast, 'children.0.name').to.eql('doc');
1227+
expectPath(ast, 'children.0.markup').toEqual('');
12271228
expectPath(ast, 'children.0.body.value').to.eql('');
12281229
expectPath(ast, 'children.0.body.type').toEqual('RawMarkup');
12291230
expectPath(ast, 'children.0.body.nodes').toEqual([]);

0 commit comments

Comments
 (0)