@markuplint/liquid-parser 4.6.21 → 4.6.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,92 @@
1
+ # @markuplint/liquid-parser
2
+
3
+ ## 概要
4
+
5
+ `@markuplint/liquid-parser` は Liquid テンプレート用の markuplint パーサープラグインです。`@markuplint/html-parser` の `HtmlParser` を拡張し、Liquid のブロックタグ(`{% ... %}`)と出力式(`{{ ... }}`)を不透明ブロックとして扱います。これにより、テンプレート構文に影響されることなく、周囲の HTML 構造を markuplint でリントできます。
6
+
7
+ ## 動作の仕組み
8
+
9
+ パーサーは基底クラス `HtmlParser` が提供する **ignoreTags** メカニズムを使用します。`HtmlParser` は `ignoreTags` エントリに遭遇すると、`start` と `end` のデリミタ間のコンテンツを AST 内の不透明な疑似要素ノード(`#ps:` プレフィックス付き)として扱います。これにより、Liquid 式は AST に保持されますが HTML としてはパースされないため、HTML リントルールに干渉しません。
10
+
11
+ `LiquidParser` クラスは適切な `ignoreTags` 設定を `HtmlParser` のコンストラクタに渡すだけで、追加のパースロジックは不要です。
12
+
13
+ ## ignoreTags 設定
14
+
15
+ | タイプ | 開始 | 終了 | 説明 |
16
+ | --------------- | ---- | ---- | ------------------------------------------- |
17
+ | `liquid-block` | `{%` | `%}` | ブロックタグ(if, for, assign, capture 等) |
18
+ | `liquid-output` | `{{` | `}}` | 出力 / 変数展開式 |
19
+
20
+ パースされたノードは AST 内でそれぞれ `#ps:liquid-block` および `#ps:liquid-output` というノード名で表示されます。
21
+
22
+ ## サポートされない構文
23
+
24
+ **引用符なしの属性値**内のテンプレート式はサポートされていません。これはすべてのテンプレートエンジンパーサーに共通する既知の制限です([#240](https://github.com/markuplint/markuplint/issues/240))。[ウェブサイトのドキュメント](https://markuplint.dev/docs/guides/besides-html)も参照してください。
25
+
26
+ 使用可能:
27
+
28
+ ```html
29
+ <div attr="{{ value }}"></div>
30
+ <div attr="{{ value }}"></div>
31
+ <div attr="{{ value }}-{{ value2 }}-{{ value3 }}"></div>
32
+ ```
33
+
34
+ 使用不可(引用符なし):
35
+
36
+ ```html
37
+ <div attr="{{" value }}></div>
38
+ ```
39
+
40
+ ## ディレクトリ構成
41
+
42
+ ```
43
+ src/
44
+ ├── index.ts — parser.ts から parser を再エクスポート
45
+ ├── parser.ts — HtmlParser を継承する LiquidParser クラス
46
+ └── index.spec.ts — ignoreTags の動作を検証するテスト
47
+ ```
48
+
49
+ ## 主要ソースファイル
50
+
51
+ | ファイル | 用途 |
52
+ | ----------- | ----------------------------------------------------------------------------------------------- |
53
+ | `parser.ts` | `LiquidParser`(`HtmlParser` を継承)を定義し、シングルトン `parser` インスタンスをエクスポート |
54
+ | `index.ts` | パッケージエントリポイント; `parser` を再エクスポート |
55
+
56
+ ## 統合ポイント
57
+
58
+ ```mermaid
59
+ flowchart TD
60
+ subgraph upstream ["上流"]
61
+ htmlParser["@markuplint/html-parser\n(HtmlParser 基底クラス)"]
62
+ parserUtils["@markuplint/parser-utils\n(抽象 Parser クラス)"]
63
+ end
64
+
65
+ subgraph pkg ["@markuplint/liquid-parser"]
66
+ liquidParser["LiquidParser\nextends HtmlParser"]
67
+ end
68
+
69
+ subgraph downstream ["下流"]
70
+ mlCore["@markuplint/ml-core\n(MLASTDocument -> MLDOM)"]
71
+ markuplint["markuplint\n(CLI / エンジン)"]
72
+ end
73
+
74
+ parserUtils -->|"Parser 基底クラス"| htmlParser
75
+ htmlParser -->|"HtmlParser + ignoreTags"| liquidParser
76
+ liquidParser -->|"MLASTDocument を生成"| mlCore
77
+ mlCore --> markuplint
78
+ ```
79
+
80
+ ### 上流
81
+
82
+ - **`@markuplint/html-parser`** -- `LiquidParser` が継承する `HtmlParser` を提供。`ignoreTags` コンストラクタオプションが中核メカニズム
83
+ - **`@markuplint/parser-utils`** -- `HtmlParser` 経由の間接依存; 抽象 `Parser` クラスと `ignoreTags` 処理を提供
84
+
85
+ ### 下流
86
+
87
+ - **`@markuplint/ml-core`** -- このパーサーが生成する `MLASTDocument` を消費して MLDOM を構築
88
+ - **`markuplint`** -- CLI/エンジンが Liquid ファイル用に設定された場合にこのパーサーをロード
89
+
90
+ ## ドキュメントマップ
91
+
92
+ - [メンテナンスガイド](docs/maintenance.ja.md) -- コマンド、レシピ、トラブルシューティング
@@ -0,0 +1,92 @@
1
+ # @markuplint/liquid-parser
2
+
3
+ ## Overview
4
+
5
+ `@markuplint/liquid-parser` is a markuplint parser plugin for Liquid templates. It extends `HtmlParser` from `@markuplint/html-parser` to treat Liquid block tags (`{% ... %}`) and output expressions (`{{ ... }}`) as opaque blocks, allowing markuplint to lint the surrounding HTML structure without being confused by template syntax.
6
+
7
+ ## How It Works
8
+
9
+ The parser uses the **ignoreTags** mechanism provided by the base `HtmlParser` class. When `HtmlParser` encounters an `ignoreTags` entry, it treats the content between the `start` and `end` delimiters as an opaque pseudo-element node in the AST (prefixed with `#ps:`). This means the Liquid expressions are preserved in the AST but are not parsed as HTML, so they do not interfere with HTML linting rules.
10
+
11
+ The `LiquidParser` class simply passes the appropriate `ignoreTags` configuration to the `HtmlParser` constructor -- no additional parsing logic is needed.
12
+
13
+ ## ignoreTags Configuration
14
+
15
+ | Type | Start | End | Description |
16
+ | --------------- | ----- | ---- | ------------------------------------------- |
17
+ | `liquid-block` | `{%` | `%}` | Block tags (if, for, assign, capture, etc.) |
18
+ | `liquid-output` | `{{` | `}}` | Output / variable interpolation expressions |
19
+
20
+ Parsed nodes appear in the AST with node names `#ps:liquid-block` and `#ps:liquid-output` respectively.
21
+
22
+ ## Unsupported Syntaxes
23
+
24
+ Template expressions inside **unquoted attribute values** are not supported. This is a known limitation shared by all template engine parsers ([#240](https://github.com/markuplint/markuplint/issues/240)). See also the [website documentation](https://markuplint.dev/docs/guides/besides-html).
25
+
26
+ Available:
27
+
28
+ ```html
29
+ <div attr="{{ value }}"></div>
30
+ <div attr="{{ value }}"></div>
31
+ <div attr="{{ value }}-{{ value2 }}-{{ value3 }}"></div>
32
+ ```
33
+
34
+ Unavailable (unquoted):
35
+
36
+ ```html
37
+ <div attr="{{" value }}></div>
38
+ ```
39
+
40
+ ## Directory Structure
41
+
42
+ ```
43
+ src/
44
+ ├── index.ts — Re-exports parser from parser.ts
45
+ ├── parser.ts — LiquidParser class extending HtmlParser
46
+ └── index.spec.ts — Tests verifying ignoreTags behavior
47
+ ```
48
+
49
+ ## Key Source Files
50
+
51
+ | File | Purpose |
52
+ | ----------- | ----------------------------------------------------------------------------------------- |
53
+ | `parser.ts` | Defines `LiquidParser` (extends `HtmlParser`) and exports the singleton `parser` instance |
54
+ | `index.ts` | Package entry point; re-exports `parser` |
55
+
56
+ ## Integration Points
57
+
58
+ ```mermaid
59
+ flowchart TD
60
+ subgraph upstream ["Upstream"]
61
+ htmlParser["@markuplint/html-parser\n(HtmlParser base class)"]
62
+ parserUtils["@markuplint/parser-utils\n(Abstract Parser class)"]
63
+ end
64
+
65
+ subgraph pkg ["@markuplint/liquid-parser"]
66
+ liquidParser["LiquidParser\nextends HtmlParser"]
67
+ end
68
+
69
+ subgraph downstream ["Downstream"]
70
+ mlCore["@markuplint/ml-core\n(MLASTDocument -> MLDOM)"]
71
+ markuplint["markuplint\n(CLI / Engine)"]
72
+ end
73
+
74
+ parserUtils -->|"Parser base class"| htmlParser
75
+ htmlParser -->|"HtmlParser + ignoreTags"| liquidParser
76
+ liquidParser -->|"produces MLASTDocument"| mlCore
77
+ mlCore --> markuplint
78
+ ```
79
+
80
+ ### Upstream
81
+
82
+ - **`@markuplint/html-parser`** -- Provides `HtmlParser` which `LiquidParser` extends. The `ignoreTags` constructor option is the core mechanism
83
+ - **`@markuplint/parser-utils`** -- Indirect dependency via `HtmlParser`; provides the abstract `Parser` class and `ignoreTags` processing
84
+
85
+ ### Downstream
86
+
87
+ - **`@markuplint/ml-core`** -- Consumes the `MLASTDocument` produced by this parser to build the MLDOM
88
+ - **`markuplint`** -- The CLI/engine loads this parser when configured for Liquid files
89
+
90
+ ## Documentation Map
91
+
92
+ - [Maintenance Guide](docs/maintenance.md) -- Commands, recipes, and troubleshooting
package/CHANGELOG.md CHANGED
@@ -3,13 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [4.6.21](https://github.com/markuplint/markuplint/compare/@markuplint/liquid-parser@4.6.20...@markuplint/liquid-parser@4.6.21) (2025-08-24)
6
+ ## [4.6.23](https://github.com/markuplint/markuplint/compare/@markuplint/liquid-parser@4.6.22...@markuplint/liquid-parser@4.6.23) (2026-02-10)
7
7
 
8
8
  **Note:** Version bump only for package @markuplint/liquid-parser
9
9
 
10
+ ## [4.6.22](https://github.com/markuplint/markuplint/compare/@markuplint/liquid-parser@4.6.21...@markuplint/liquid-parser@4.6.22) (2025-11-05)
10
11
 
12
+ **Note:** Version bump only for package @markuplint/liquid-parser
11
13
 
14
+ ## [4.6.21](https://github.com/markuplint/markuplint/compare/@markuplint/liquid-parser@4.6.20...@markuplint/liquid-parser@4.6.21) (2025-08-24)
12
15
 
16
+ **Note:** Version bump only for package @markuplint/liquid-parser
13
17
 
14
18
  ## [4.6.20](https://github.com/markuplint/markuplint/compare/@markuplint/liquid-parser@4.6.19...@markuplint/liquid-parser@4.6.20) (2025-08-13)
15
19
 
package/SKILL.md ADDED
@@ -0,0 +1,89 @@
1
+ ---
2
+ description: Perform maintenance tasks for @markuplint/liquid-parser
3
+ globs:
4
+ - packages/@markuplint/liquid-parser/src/**
5
+ alwaysApply: false
6
+ ---
7
+
8
+ # liquid-parser-maintenance
9
+
10
+ Perform maintenance tasks for `@markuplint/liquid-parser`: add new ignoreTags entries
11
+ for additional Liquid syntax, or modify existing ignoreTags configuration.
12
+
13
+ ## Input
14
+
15
+ `$ARGUMENTS` specifies the task. Supported tasks:
16
+
17
+ | Task | Description |
18
+ | ------------------- | -------------------------------------------- |
19
+ | `add-ignore-tag` | Add a new ignoreTags entry for Liquid syntax |
20
+ | `modify-ignore-tag` | Modify an existing ignoreTags entry |
21
+
22
+ If omitted, defaults to `add-ignore-tag`.
23
+
24
+ ## Reference
25
+
26
+ Before executing any task, read `docs/maintenance.md` (or `docs/maintenance.ja.md`)
27
+ for the full guide. The recipes there are the source of truth for procedures.
28
+
29
+ Also read:
30
+
31
+ - `ARCHITECTURE.md` -- Package overview, ignoreTags mechanism, and integration points
32
+ - `src/parser.ts` -- LiquidParser class (source of truth for ignoreTags configuration)
33
+
34
+ ## Task: add-ignore-tag
35
+
36
+ Add a new ignoreTags entry for additional Liquid syntax. Follow recipe #1 in `docs/maintenance.md`.
37
+
38
+ ### Step 1: Identify the syntax
39
+
40
+ 1. Determine the start and end delimiters for the new Liquid syntax
41
+ 2. Choose a descriptive `type` name with a `liquid-` prefix (e.g., `liquid-comment`)
42
+
43
+ ### Step 2: Add the entry
44
+
45
+ 1. Read `src/parser.ts`
46
+ 2. Add a new object to the `ignoreTags` array in the `LiquidParser` constructor:
47
+ ```ts
48
+ {
49
+ type: 'liquid-<name>',
50
+ start: '<start-delimiter>',
51
+ end: '<end-delimiter>',
52
+ },
53
+ ```
54
+
55
+ ### Step 3: Add tests
56
+
57
+ 1. Read `src/index.spec.ts`
58
+ 2. Add a test case verifying the new tag is parsed as `#ps:liquid-<name>`
59
+
60
+ ### Step 4: Verify
61
+
62
+ 1. Build: `yarn build --scope @markuplint/liquid-parser`
63
+ 2. Test: `yarn test --scope @markuplint/liquid-parser`
64
+
65
+ ## Task: modify-ignore-tag
66
+
67
+ Modify an existing ignoreTags entry. Follow recipe #2 in `docs/maintenance.md`.
68
+
69
+ ### Step 1: Identify the entry
70
+
71
+ 1. Read `src/parser.ts` and find the ignoreTags entry to modify
72
+ 2. Understand the current start/end delimiters and type name
73
+
74
+ ### Step 2: Make the change
75
+
76
+ 1. Update the `type`, `start`, or `end` fields as needed
77
+ 2. If changing the `type` name, update the corresponding test in `src/index.spec.ts`
78
+
79
+ ### Step 3: Verify
80
+
81
+ 1. Build: `yarn build --scope @markuplint/liquid-parser`
82
+ 2. Test: `yarn test --scope @markuplint/liquid-parser`
83
+
84
+ ## Rules
85
+
86
+ 1. **Use the `liquid-` prefix** for all ignoreTags type names to maintain consistency.
87
+ 2. **Add a test case** for every new ignoreTags entry.
88
+ 3. **Add JSDoc comments** to document any new public exports.
89
+ 4. **Keep the parser minimal** -- all parsing logic is handled by the upstream `HtmlParser` via `ignoreTags`. Do not add custom parsing methods unless absolutely necessary.
@@ -0,0 +1,106 @@
1
+ # メンテナンスガイド
2
+
3
+ ## コマンド
4
+
5
+ | コマンド | 説明 |
6
+ | ---------------------------------------------- | ---------------------- |
7
+ | `yarn build --scope @markuplint/liquid-parser` | このパッケージをビルド |
8
+ | `yarn dev --scope @markuplint/liquid-parser` | ウォッチモードでビルド |
9
+ | `yarn clean --scope @markuplint/liquid-parser` | ビルド成果物を削除 |
10
+ | `yarn test --scope @markuplint/liquid-parser` | テストを実行 |
11
+
12
+ ## テスト
13
+
14
+ テストファイルは `*.spec.ts` の命名規則に従い、`src/` ディレクトリに配置されています:
15
+
16
+ | テストファイル | カバレッジ |
17
+ | --------------- | ---------------------------------------------------------------- |
18
+ | `index.spec.ts` | 各 ignoreTags エントリが正しい `#ps:` ノードを生成することを検証 |
19
+
20
+ 主なテストパターンでは、テンプレート文字列をパースし、結果のノード名を確認します:
21
+
22
+ ```ts
23
+ import { parser } from './parser.js';
24
+
25
+ const parse = parser.parse.bind(parser);
26
+
27
+ expect(parse('{% any %}').nodeList[0]?.nodeName).toBe('#ps:liquid-block');
28
+ expect(parse('{{ any }}').nodeList[0]?.nodeName).toBe('#ps:liquid-output');
29
+ ```
30
+
31
+ ## レシピ
32
+
33
+ ### 1. 新しい ignoreTags エントリの追加
34
+
35
+ Liquid が新しい構文を導入し、不透明ブロックとして扱う必要がある場合にこのレシピを使用します。
36
+
37
+ 1. `src/parser.ts` を開く
38
+ 2. `LiquidParser` コンストラクタの `ignoreTags` 配列に新しいオブジェクトを追加:
39
+ ```ts
40
+ {
41
+ type: 'liquid-<name>',
42
+ start: '<開始デリミタ>',
43
+ end: '<終了デリミタ>',
44
+ },
45
+ ```
46
+ 3. `src/index.spec.ts` を開き、テストを追加:
47
+ ```ts
48
+ test('liquid-<name>', () => {
49
+ expect(parse('<開始デリミタ> any <終了デリミタ>').nodeList[0]?.nodeName).toBe('#ps:liquid-<name>');
50
+ });
51
+ ```
52
+ 4. ビルドとテスト:
53
+ ```shell
54
+ yarn build --scope @markuplint/liquid-parser && yarn test --scope @markuplint/liquid-parser
55
+ ```
56
+
57
+ ### 2. 既存の ignoreTags エントリの変更
58
+
59
+ デリミタの変更や ignoreTags タイプのリネームを行う場合にこのレシピを使用します。
60
+
61
+ 1. `src/parser.ts` を開き、`ignoreTags` 配列内の変更対象エントリを特定
62
+ 2. `type`、`start`、または `end` フィールドを必要に応じて更新
63
+ 3. `src/index.spec.ts` の対応するテストを新しい値に合わせて更新
64
+ 4. ビルドとテスト:
65
+ ```shell
66
+ yarn build --scope @markuplint/liquid-parser && yarn test --scope @markuplint/liquid-parser
67
+ ```
68
+
69
+ **注意:** `type` 名を変更すると AST 内の `#ps:` ノード名が変わります。特定のノード名にマッチしている下流の利用者は更新が必要です。
70
+
71
+ ## 上流依存
72
+
73
+ このパッケージのパース動作は `@markuplint/html-parser` に完全に依存しています。`HtmlParser` の `ignoreTags` メカニズムが変更された場合、このパーサーに影響が及ぶ可能性があります。
74
+
75
+ 上流パッケージと合わせてテストするには:
76
+
77
+ ```shell
78
+ yarn build --scope @markuplint/html-parser --scope @markuplint/liquid-parser
79
+ yarn test --scope @markuplint/liquid-parser
80
+ ```
81
+
82
+ ## トラブルシューティング
83
+
84
+ ### Liquid 式が不透明ブロックではなく HTML としてパースされる
85
+
86
+ **症状:** `{% if condition %}` のような Liquid タグが HTML パースエラーを発生させるか、`#ps:liquid-block` ノードとして認識されない。
87
+
88
+ **原因:** `ignoreTags` エントリの `start` または `end` デリミタがソース内の構文と一致していない。
89
+
90
+ **解決策:**
91
+
92
+ 1. `src/parser.ts` を確認 — `start` と `end` の文字列が Liquid のデリミタと正確に一致していることを検証
93
+ 2. デリミタ文字列に空白の問題がないことを確認
94
+ 3. テストスイートを実行して確認: `yarn test --scope @markuplint/liquid-parser`
95
+
96
+ ### 新しい ignoreTags エントリが認識されない
97
+
98
+ **症状:** 新しいエントリを追加した後も、パーサーがその構文を HTML として扱う。
99
+
100
+ **原因:** ビルド出力が古い。
101
+
102
+ **解決策:**
103
+
104
+ 1. 再ビルド: `yarn build --scope @markuplint/liquid-parser`
105
+ 2. `lib/parser.js` にエントリが含まれていることを確認
106
+ 3. テスト実行: `yarn test --scope @markuplint/liquid-parser`
@@ -0,0 +1,106 @@
1
+ # Maintenance Guide
2
+
3
+ ## Commands
4
+
5
+ | Command | Description |
6
+ | ---------------------------------------------- | ---------------------- |
7
+ | `yarn build --scope @markuplint/liquid-parser` | Build this package |
8
+ | `yarn dev --scope @markuplint/liquid-parser` | Watch mode build |
9
+ | `yarn clean --scope @markuplint/liquid-parser` | Remove build artifacts |
10
+ | `yarn test --scope @markuplint/liquid-parser` | Run tests |
11
+
12
+ ## Testing
13
+
14
+ Test files follow the `*.spec.ts` naming convention and are located in the `src/` directory:
15
+
16
+ | Test File | Coverage |
17
+ | --------------- | --------------------------------------------------------------- |
18
+ | `index.spec.ts` | Verifies each ignoreTags entry produces the correct `#ps:` node |
19
+
20
+ The primary testing pattern parses a template string and checks the resulting node name:
21
+
22
+ ```ts
23
+ import { parser } from './parser.js';
24
+
25
+ const parse = parser.parse.bind(parser);
26
+
27
+ expect(parse('{% any %}').nodeList[0]?.nodeName).toBe('#ps:liquid-block');
28
+ expect(parse('{{ any }}').nodeList[0]?.nodeName).toBe('#ps:liquid-output');
29
+ ```
30
+
31
+ ## Recipes
32
+
33
+ ### 1. Adding a New ignoreTags Entry
34
+
35
+ Use this recipe when Liquid introduces new syntax that needs to be treated as an opaque block.
36
+
37
+ 1. Open `src/parser.ts`
38
+ 2. Add a new object to the `ignoreTags` array in the `LiquidParser` constructor:
39
+ ```ts
40
+ {
41
+ type: 'liquid-<name>',
42
+ start: '<start-delimiter>',
43
+ end: '<end-delimiter>',
44
+ },
45
+ ```
46
+ 3. Open `src/index.spec.ts` and add a test:
47
+ ```ts
48
+ test('liquid-<name>', () => {
49
+ expect(parse('<start-delimiter> any <end-delimiter>').nodeList[0]?.nodeName).toBe('#ps:liquid-<name>');
50
+ });
51
+ ```
52
+ 4. Build and test:
53
+ ```shell
54
+ yarn build --scope @markuplint/liquid-parser && yarn test --scope @markuplint/liquid-parser
55
+ ```
56
+
57
+ ### 2. Modifying an Existing ignoreTags Entry
58
+
59
+ Use this recipe to change delimiters or rename an ignoreTags type.
60
+
61
+ 1. Open `src/parser.ts` and locate the entry to modify in the `ignoreTags` array
62
+ 2. Update the `type`, `start`, or `end` fields as needed
63
+ 3. Update the corresponding test in `src/index.spec.ts` to match the new values
64
+ 4. Build and test:
65
+ ```shell
66
+ yarn build --scope @markuplint/liquid-parser && yarn test --scope @markuplint/liquid-parser
67
+ ```
68
+
69
+ **Note:** Changing the `type` name changes the `#ps:` node name in the AST. Downstream consumers that match on specific node names will need to be updated.
70
+
71
+ ## Upstream Dependency
72
+
73
+ This package depends entirely on `@markuplint/html-parser` for its parsing behavior. If the `ignoreTags` mechanism in `HtmlParser` changes, this parser may be affected.
74
+
75
+ To test with the upstream package:
76
+
77
+ ```shell
78
+ yarn build --scope @markuplint/html-parser --scope @markuplint/liquid-parser
79
+ yarn test --scope @markuplint/liquid-parser
80
+ ```
81
+
82
+ ## Troubleshooting
83
+
84
+ ### Liquid expression is parsed as HTML instead of an opaque block
85
+
86
+ **Symptom:** A Liquid tag like `{% if condition %}` produces HTML parse errors or is not recognized as a `#ps:liquid-block` node.
87
+
88
+ **Cause:** The `start` or `end` delimiters in the `ignoreTags` entry do not match the syntax in the source.
89
+
90
+ **Solution:**
91
+
92
+ 1. Check `src/parser.ts` -- verify the `start` and `end` strings exactly match the Liquid delimiters
93
+ 2. Ensure there are no whitespace issues in the delimiter strings
94
+ 3. Run the test suite to confirm: `yarn test --scope @markuplint/liquid-parser`
95
+
96
+ ### New ignoreTags entry is not recognized
97
+
98
+ **Symptom:** After adding a new entry, the parser still treats the syntax as HTML.
99
+
100
+ **Cause:** The build output is stale.
101
+
102
+ **Solution:**
103
+
104
+ 1. Rebuild: `yarn build --scope @markuplint/liquid-parser`
105
+ 2. Verify the entry appears in `lib/parser.js`
106
+ 3. Run tests: `yarn test --scope @markuplint/liquid-parser`
package/lib/index.d.ts CHANGED
@@ -1 +1,7 @@
1
+ /**
2
+ * @module @markuplint/liquid-parser
3
+ * Markuplint parser plugin for Liquid templates. Extends the standard HTML parser
4
+ * to treat Liquid block tags and output expressions as opaque blocks, allowing
5
+ * markuplint to lint the surrounding HTML structure.
6
+ */
1
7
  export { parser } from './parser.js';
package/lib/index.js CHANGED
@@ -1 +1,7 @@
1
+ /**
2
+ * @module @markuplint/liquid-parser
3
+ * Markuplint parser plugin for Liquid templates. Extends the standard HTML parser
4
+ * to treat Liquid block tags and output expressions as opaque blocks, allowing
5
+ * markuplint to lint the surrounding HTML structure.
6
+ */
1
7
  export { parser } from './parser.js';
package/lib/parser.d.ts CHANGED
@@ -1,6 +1,16 @@
1
1
  import { HtmlParser } from '@markuplint/html-parser';
2
+ /**
3
+ * Parser for Liquid templates that extends the standard HTML parser.
4
+ *
5
+ * Configures the HTML parser to recognize Liquid tag variants as opaque blocks:
6
+ * - `{% ... %}` (block tags such as if, for, assign)
7
+ * - `{{ ... }}` (output / variable interpolation)
8
+ */
2
9
  declare class LiquidParser extends HtmlParser {
3
10
  constructor();
4
11
  }
12
+ /**
13
+ * Singleton Liquid parser instance for use by the markuplint engine.
14
+ */
5
15
  export declare const parser: LiquidParser;
6
16
  export {};
package/lib/parser.js CHANGED
@@ -1,4 +1,11 @@
1
1
  import { HtmlParser } from '@markuplint/html-parser';
2
+ /**
3
+ * Parser for Liquid templates that extends the standard HTML parser.
4
+ *
5
+ * Configures the HTML parser to recognize Liquid tag variants as opaque blocks:
6
+ * - `{% ... %}` (block tags such as if, for, assign)
7
+ * - `{{ ... }}` (output / variable interpolation)
8
+ */
2
9
  class LiquidParser extends HtmlParser {
3
10
  constructor() {
4
11
  super({
@@ -17,4 +24,7 @@ class LiquidParser extends HtmlParser {
17
24
  });
18
25
  }
19
26
  }
27
+ /**
28
+ * Singleton Liquid parser instance for use by the markuplint engine.
29
+ */
20
30
  export const parser = new LiquidParser();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/liquid-parser",
3
- "version": "4.6.21",
3
+ "version": "4.6.23",
4
4
  "description": "Liquid template parser for markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -21,10 +21,10 @@
21
21
  "clean": "tsc --build --clean tsconfig.build.json"
22
22
  },
23
23
  "dependencies": {
24
- "@markuplint/html-parser": "4.6.21"
24
+ "@markuplint/html-parser": "4.6.23"
25
25
  },
26
26
  "devDependencies": {
27
- "@markuplint/parser-utils": "4.8.9"
27
+ "@markuplint/parser-utils": "4.8.11"
28
28
  },
29
- "gitHead": "ae97eb2d31ecedf4f0800fbbf18588aad4ebca04"
29
+ "gitHead": "193ee7c1262bbed95424e38efdf1a8e56ff049f4"
30
30
  }