liquid-parser-maintenance
Perform maintenance tasks for @markuplint/liquid-parser: add new ignoreTags entries
for additional Liquid syntax, or modify existing ignoreTags configuration.
Input
$ARGUMENTS specifies the task. Supported tasks:
| Task | Description |
|---|---|
add-ignore-tag | Add a new ignoreTags entry for Liquid syntax |
modify-ignore-tag | Modify an existing ignoreTags entry |
If omitted, defaults to add-ignore-tag.
Reference
Before executing any task, read docs/maintenance.md (or docs/maintenance.ja.md)
for the full guide. The recipes there are the source of truth for procedures.
Also read:
- •
ARCHITECTURE.md-- Package overview, ignoreTags mechanism, and integration points - •
src/parser.ts-- LiquidParser class (source of truth for ignoreTags configuration)
Task: add-ignore-tag
Add a new ignoreTags entry for additional Liquid syntax. Follow recipe #1 in docs/maintenance.md.
Step 1: Identify the syntax
- •Determine the start and end delimiters for the new Liquid syntax
- •Choose a descriptive
typename with aliquid-prefix (e.g.,liquid-comment)
Step 2: Add the entry
- •Read
src/parser.ts - •Add a new object to the
ignoreTagsarray in theLiquidParserconstructor:ts{ type: 'liquid-<name>', start: '<start-delimiter>', end: '<end-delimiter>', },
Step 3: Add tests
- •Read
src/index.spec.ts - •Add a test case verifying the new tag is parsed as
#ps:liquid-<name>
Step 4: Verify
- •Build:
yarn build --scope @markuplint/liquid-parser - •Test:
yarn test --scope @markuplint/liquid-parser
Task: modify-ignore-tag
Modify an existing ignoreTags entry. Follow recipe #2 in docs/maintenance.md.
Step 1: Identify the entry
- •Read
src/parser.tsand find the ignoreTags entry to modify - •Understand the current start/end delimiters and type name
Step 2: Make the change
- •Update the
type,start, orendfields as needed - •If changing the
typename, update the corresponding test insrc/index.spec.ts
Step 3: Verify
- •Build:
yarn build --scope @markuplint/liquid-parser - •Test:
yarn test --scope @markuplint/liquid-parser
Rules
- •Use the
liquid-prefix for all ignoreTags type names to maintain consistency. - •Add a test case for every new ignoreTags entry.
- •Add JSDoc comments to document any new public exports.
- •Keep the parser minimal -- all parsing logic is handled by the upstream
HtmlParserviaignoreTags. Do not add custom parsing methods unless absolutely necessary.