Skip to content

Commit

Permalink
Add 'doc' to TAGS_WITHOUT_MARKUP
Browse files Browse the repository at this point in the history
reason: doc tag cannot have markup, so we strip it if present in stage 2.
  • Loading branch information
jamesmengo committed Dec 3, 2024
1 parent 2fa3af7 commit 55b9135
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/liquid-html-parser/src/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ export const TAGS_WITHOUT_MARKUP = [
'continue',
'comment',
'raw',
'doc',
];
1 change: 1 addition & 0 deletions packages/liquid-html-parser/src/stage-2-ast.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,7 @@ describe('Unit: Stage 2 (AST)', () => {
ast = toLiquidAST(`{% doc %}{% enddoc %}`);
expectPath(ast, 'children.0.type').to.eql('LiquidRawTag');
expectPath(ast, 'children.0.name').to.eql('doc');
expectPath(ast, 'children.0.markup').toEqual('');
expectPath(ast, 'children.0.body.value').to.eql('');
expectPath(ast, 'children.0.body.type').toEqual('RawMarkup');
expectPath(ast, 'children.0.body.nodes').toEqual([]);
Expand Down

0 comments on commit 55b9135

Please sign in to comment.