@markuplint/ejs-parser 4.6.22 → 4.18.0

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,87 @@
1
+ # @markuplint/ejs-parser
2
+
3
+ ## 概要
4
+
5
+ `@markuplint/ejs-parser` は `HtmlParser` を拡張し、EJS(Embedded JavaScript)テンプレート式を含む HTML のリントを可能にします。
6
+
7
+ ## 動作の仕組み
8
+
9
+ このパーサーは基底の `HtmlParser` が提供する `ignoreTags` メカニズムを使用します:
10
+
11
+ 1. **マスク** — パース前に、すべての EJS テンプレート式(`<% ... %>` およびそのバリアント)が開始/終了デリミタにより識別され、プレースホルダーテキストに置換される
12
+ 2. **パース** — マスクされた HTML は、テンプレート式が存在しないかのように標準 HTML パーサー(parse5)によってパースされる
13
+ 3. **保持** — 元の EJS 式は AST 内に `#ps:*`(PreprocessorSpecificBlock)ノードとして保持され、ソース位置も維持される
14
+
15
+ このアプローチにより、markuplint は EJS 構文に影響されることなく HTML 構造をリントできます。
16
+
17
+ ## ignoreTags 設定
18
+
19
+ `EJSParser` コンストラクタは、正しいマッチングを保証するために、最も具体的なものから順に5つのパターンを定義しています:
20
+
21
+ | タイプ | 開始 | 終了 | 説明 |
22
+ | ------------------------- | ----------- | ---- | ---------------------------------------------- |
23
+ | `ejs-whitespace-slurping` | `<%_` | `%>` | 空白除去スクリプトレット(前方の空白をトリム) |
24
+ | `ejs-output-value` | `<%=` | `%>` | エスケープ済み出力(HTML セーフ) |
25
+ | `ejs-output-unescaped` | `<%-` | `%>` | エスケープなし出力(生 HTML) |
26
+ | `ejs-comment` | `<%#` | `%>` | EJS コメント(レンダリングされない) |
27
+ | `ejs-scriptlet` | `/<%(?!%)/` | `%>` | プレーンスクリプトレット(制御フロー等) |
28
+
29
+ `ejs-scriptlet` パターンは否定先読み `(?!%)` を持つ正規表現を使用し、リテラルエスケープシーケンス `<%%` とのマッチを回避しています。
30
+
31
+ ## サポートされない構文
32
+
33
+ **引用符なしの属性値**内のテンプレート式はサポートされていません。これはすべてのテンプレートエンジンパーサーに共通する既知の制限です([#240](https://github.com/markuplint/markuplint/issues/240))。[ウェブサイトのドキュメント](https://markuplint.dev/docs/guides/besides-html)も参照してください。
34
+
35
+ 使用可能:
36
+
37
+ ```html
38
+ <div attr="<%= value %>"></div>
39
+ <div attr="<%= value %>"></div>
40
+ <div attr="<%= value %>-<%= value2 %>-<%= value3 %>"></div>
41
+ ```
42
+
43
+ 使用不可(引用符なし):
44
+
45
+ ```html
46
+ <div attr=<%= value %>></div>
47
+ ```
48
+
49
+ ## ディレクトリ構成
50
+
51
+ ```
52
+ src/
53
+ ├── index.ts — parser を再エクスポート
54
+ ├── parser.ts — HtmlParser を拡張する EJSParser クラス
55
+ └── index.spec.ts — パーサー統合テスト
56
+ ```
57
+
58
+ ## 主要ソースファイル
59
+
60
+ | ファイル | 用途 |
61
+ | --------------- | ---------------------------------------------------------------- |
62
+ | `src/parser.ts` | `EJSParser` クラスを定義し、シングルトン `parser` をエクスポート |
63
+ | `src/index.ts` | パッケージエントリーポイント。`parser` を再エクスポート |
64
+
65
+ ## 統合ポイント
66
+
67
+ ```mermaid
68
+ flowchart TD
69
+ subgraph upstream ["上流"]
70
+ htmlParser["@markuplint/html-parser\n(HtmlParser クラス)"]
71
+ end
72
+
73
+ subgraph pkg ["@markuplint/ejs-parser"]
74
+ ejsParser["EJSParser\nextends HtmlParser\n(ignoreTags のみ)"]
75
+ end
76
+
77
+ subgraph downstream ["下流"]
78
+ mlCore["@markuplint/ml-core\n(MLASTDocument → MLDOM)"]
79
+ end
80
+
81
+ htmlParser -->|"継承"| ejsParser
82
+ ejsParser -->|"MLASTDocument を生成"| mlCore
83
+ ```
84
+
85
+ ## ドキュメントマップ
86
+
87
+ - [メンテナンスガイド](docs/maintenance.ja.md) — コマンド、レシピ、テスト
@@ -0,0 +1,87 @@
1
+ # @markuplint/ejs-parser
2
+
3
+ ## Overview
4
+
5
+ `@markuplint/ejs-parser` extends `HtmlParser` to lint HTML containing EJS (Embedded JavaScript) template expressions.
6
+
7
+ ## How It Works
8
+
9
+ The parser uses the `ignoreTags` mechanism provided by the base `HtmlParser`:
10
+
11
+ 1. **Mask** — Before parsing, all EJS template expressions (`<% ... %>` and variants) are identified by their start/end delimiters and replaced with placeholder text
12
+ 2. **Parse** — The masked HTML is parsed by the standard HTML parser (parse5) as if the template expressions did not exist
13
+ 3. **Preserve** — The original EJS expressions are preserved in the AST as `#ps:*` (PreprocessorSpecificBlock) nodes, maintaining their source positions
14
+
15
+ This approach allows markuplint to lint the HTML structure without being confused by EJS syntax.
16
+
17
+ ## ignoreTags Configuration
18
+
19
+ The `EJSParser` constructor defines five ignore patterns, ordered from most specific to least specific to ensure correct matching:
20
+
21
+ | Type | Start | End | Description |
22
+ | ------------------------- | ----------- | ---- | ------------------------------------------------------ |
23
+ | `ejs-whitespace-slurping` | `<%_` | `%>` | Whitespace-slurping scriptlets (trims preceding space) |
24
+ | `ejs-output-value` | `<%=` | `%>` | Escaped output (HTML-safe) |
25
+ | `ejs-output-unescaped` | `<%-` | `%>` | Unescaped output (raw HTML) |
26
+ | `ejs-comment` | `<%#` | `%>` | EJS comments (not rendered) |
27
+ | `ejs-scriptlet` | `/<%(?!%)/` | `%>` | Plain scriptlets (control flow, etc.) |
28
+
29
+ The `ejs-scriptlet` pattern uses a regex with a negative lookahead `(?!%)` to avoid matching the literal escape sequence `<%%`.
30
+
31
+ ## Unsupported Syntaxes
32
+
33
+ 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).
34
+
35
+ Available:
36
+
37
+ ```html
38
+ <div attr="<%= value %>"></div>
39
+ <div attr="<%= value %>"></div>
40
+ <div attr="<%= value %>-<%= value2 %>-<%= value3 %>"></div>
41
+ ```
42
+
43
+ Unavailable (unquoted):
44
+
45
+ ```html
46
+ <div attr=<%= value %>></div>
47
+ ```
48
+
49
+ ## Directory Structure
50
+
51
+ ```
52
+ src/
53
+ ├── index.ts — Re-exports parser
54
+ ├── parser.ts — EJSParser class extending HtmlParser
55
+ └── index.spec.ts — Parser integration tests
56
+ ```
57
+
58
+ ## Key Source Files
59
+
60
+ | File | Purpose |
61
+ | --------------- | ----------------------------------------------------------------- |
62
+ | `src/parser.ts` | Defines `EJSParser` class and exports singleton `parser` instance |
63
+ | `src/index.ts` | Package entry point; re-exports `parser` |
64
+
65
+ ## Integration Points
66
+
67
+ ```mermaid
68
+ flowchart TD
69
+ subgraph upstream ["Upstream"]
70
+ htmlParser["@markuplint/html-parser\n(HtmlParser class)"]
71
+ end
72
+
73
+ subgraph pkg ["@markuplint/ejs-parser"]
74
+ ejsParser["EJSParser\nextends HtmlParser\n(ignoreTags only)"]
75
+ end
76
+
77
+ subgraph downstream ["Downstream"]
78
+ mlCore["@markuplint/ml-core\n(MLASTDocument → MLDOM)"]
79
+ end
80
+
81
+ htmlParser -->|"extends"| ejsParser
82
+ ejsParser -->|"produces MLASTDocument"| mlCore
83
+ ```
84
+
85
+ ## Documentation Map
86
+
87
+ - [Maintenance Guide](docs/maintenance.md) — Commands, recipes, and testing
package/CHANGELOG.md CHANGED
@@ -3,13 +3,21 @@
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.22](https://github.com/markuplint/markuplint/compare/@markuplint/ejs-parser@4.6.21...@markuplint/ejs-parser@4.6.22) (2025-11-05)
6
+ # [4.18.0](https://github.com/markuplint/markuplint/compare/v4.14.1...v4.18.0) (2026-04-22)
7
7
 
8
8
  **Note:** Version bump only for package @markuplint/ejs-parser
9
9
 
10
+ ## [4.6.24](https://github.com/markuplint/markuplint/compare/@markuplint/ejs-parser@4.6.23...@markuplint/ejs-parser@4.6.24) (2026-04-21)
11
+
12
+ **Note:** Version bump only for package @markuplint/ejs-parser
10
13
 
14
+ ## [4.6.23](https://github.com/markuplint/markuplint/compare/@markuplint/ejs-parser@4.6.22...@markuplint/ejs-parser@4.6.23) (2026-02-10)
11
15
 
16
+ **Note:** Version bump only for package @markuplint/ejs-parser
12
17
 
18
+ ## [4.6.22](https://github.com/markuplint/markuplint/compare/@markuplint/ejs-parser@4.6.21...@markuplint/ejs-parser@4.6.22) (2025-11-05)
19
+
20
+ **Note:** Version bump only for package @markuplint/ejs-parser
13
21
 
14
22
  ## [4.6.21](https://github.com/markuplint/markuplint/compare/@markuplint/ejs-parser@4.6.20...@markuplint/ejs-parser@4.6.21) (2025-08-24)
15
23
 
package/SKILL.md ADDED
@@ -0,0 +1,54 @@
1
+ ---
2
+ description: Perform maintenance tasks for @markuplint/ejs-parser
3
+ globs:
4
+ - packages/@markuplint/ejs-parser/src/**
5
+ alwaysApply: false
6
+ ---
7
+
8
+ # @markuplint/ejs-parser Maintenance
9
+
10
+ You are maintaining `@markuplint/ejs-parser`, the EJS template parser for markuplint.
11
+
12
+ ## Architecture
13
+
14
+ See [ARCHITECTURE.md](ARCHITECTURE.md) for the full architecture overview including the ignoreTags mechanism and integration points.
15
+
16
+ For detailed maintenance procedures, see [docs/maintenance.md](docs/maintenance.md) ([Japanese](docs/maintenance.ja.md)).
17
+
18
+ ## Key Files
19
+
20
+ | File | Role |
21
+ | --------------- | --------------------------------------------- |
22
+ | `src/parser.ts` | EJSParser class with ignoreTags configuration |
23
+ | `src/index.ts` | Package entry point; re-exports parser |
24
+
25
+ ## Tasks
26
+
27
+ ### add-ignore-tag
28
+
29
+ Add a new EJS tag variant to the ignoreTags configuration.
30
+
31
+ 1. Open `src/parser.ts`
32
+ 2. Add a new entry to the `ignoreTags` array in the `EJSParser` constructor
33
+ - Place it **before** `ejs-scriptlet` (the catch-all pattern must remain last)
34
+ - Use a string for the `start` delimiter if it is a fixed prefix
35
+ - Use a regex for `start` only if pattern matching is needed
36
+ 3. Add a test case in `src/index.spec.ts` under the `Tags` describe block:
37
+ ```ts
38
+ test('new-type-name', () => {
39
+ expect(parse('<new-delimiter any %>').nodeList[0].nodeName).toBe('#ps:new-type-name');
40
+ });
41
+ ```
42
+ 4. Build: `yarn build --scope @markuplint/ejs-parser`
43
+ 5. Test: `yarn test --scope @markuplint/ejs-parser`
44
+
45
+ ### modify-ignore-tag
46
+
47
+ Modify an existing EJS tag pattern (start/end delimiter or type name).
48
+
49
+ 1. Open `src/parser.ts`
50
+ 2. Find the target entry in the `ignoreTags` array and update `type`, `start`, or `end`
51
+ 3. Update affected test cases in `src/index.spec.ts`
52
+ - Check both `Tags` tests (nodeName assertions) and `Node list` tests (debug map snapshots)
53
+ 4. Build: `yarn build --scope @markuplint/ejs-parser`
54
+ 5. Test: `yarn test --scope @markuplint/ejs-parser`
@@ -0,0 +1,84 @@
1
+ # メンテナンスガイド
2
+
3
+ ## コマンド
4
+
5
+ | コマンド | 説明 |
6
+ | ------------------------------------------- | ---------------------- |
7
+ | `yarn build --scope @markuplint/ejs-parser` | このパッケージをビルド |
8
+ | `yarn dev --scope @markuplint/ejs-parser` | ウォッチモードでビルド |
9
+ | `yarn clean --scope @markuplint/ejs-parser` | ビルド成果物を削除 |
10
+ | `yarn test --scope @markuplint/ejs-parser` | テストを実行 |
11
+
12
+ ## テスト
13
+
14
+ テストファイルは `*.spec.ts` の命名規則に従い、`src/` ディレクトリに配置されています:
15
+
16
+ | テストファイル | カバレッジ |
17
+ | --------------- | ---------------------------------------------------------- |
18
+ | `index.spec.ts` | EJSParser 統合テスト(ノードリスト構造、タグタイプ検出等) |
19
+
20
+ 主なテストパターンでは `nodeListToDebugMaps` を使用したスナップショット形式のアサーションを行います:
21
+
22
+ ```ts
23
+ import { nodeListToDebugMaps } from '@markuplint/parser-utils';
24
+ import { parser } from './parser.js';
25
+
26
+ const doc = parser.parse('<div><%= value %></div>');
27
+ expect(nodeListToDebugMaps(doc.nodeList)).toStrictEqual([
28
+ '[1:1]>[1:6](0,5)div: <div>',
29
+ '[1:6]>[1:18](5,17)#ps:ejs-output-value: <%=␣value␣%>',
30
+ '[1:18]>[1:24](17,23)div: </div>',
31
+ ]);
32
+ ```
33
+
34
+ タグタイプ検出テストでは、各 EJS バリアントが正しい `#ps:*` ノード名を生成することを検証します:
35
+
36
+ ```ts
37
+ expect(parse('<%_ any _%>').nodeList[0].nodeName).toBe('#ps:ejs-whitespace-slurping');
38
+ expect(parse('<%= any %>').nodeList[0].nodeName).toBe('#ps:ejs-output-value');
39
+ expect(parse('<%- any -%>').nodeList[0].nodeName).toBe('#ps:ejs-output-unescaped');
40
+ expect(parse('<%# any %>').nodeList[0].nodeName).toBe('#ps:ejs-comment');
41
+ expect(parse('<% any %>').nodeList[0].nodeName).toBe('#ps:ejs-scriptlet');
42
+ ```
43
+
44
+ ## レシピ
45
+
46
+ ### 1. ignoreTags パターンの追加
47
+
48
+ 新しい EJS タグバリアントのサポートが必要な場合:
49
+
50
+ 1. `src/parser.ts` を開く
51
+ 2. コンストラクタの `ignoreTags` 配列に新しいエントリを追加:
52
+ ```ts
53
+ {
54
+ type: 'ejs-new-variant',
55
+ start: '<%X',
56
+ end: '%>',
57
+ },
58
+ ```
59
+ 3. **順序が重要** — 新しいエントリは `ejs-scriptlet` の前に配置すること。`ejs-scriptlet` パターンはキャッチオール正規表現(`/<%(?!%)/`)を使用しており、より具体的なパターンとのマッチを避けるため最後に配置する必要がある
60
+ 4. `src/index.spec.ts` にタグ検出テストを追加:
61
+ ```ts
62
+ test('ejs-new-variant', () => {
63
+ expect(parse('<%X any %>').nodeList[0].nodeName).toBe('#ps:ejs-new-variant');
64
+ });
65
+ ```
66
+ 5. 新しいバリアントに特別なパース動作がある場合、ノードリスト統合テストも追加
67
+ 6. ビルド: `yarn build --scope @markuplint/ejs-parser`
68
+ 7. テスト: `yarn test --scope @markuplint/ejs-parser`
69
+
70
+ ### 2. ignoreTags パターンの変更
71
+
72
+ 開始/終了デリミタの変更やタイプ名の変更:
73
+
74
+ 1. `src/parser.ts` を開き、`ignoreTags` 内の対象エントリを見つける
75
+ 2. `type`、`start`、`end` フィールドを必要に応じて変更
76
+ 3. `src/index.spec.ts` 内の影響を受けるすべてのテストを更新:
77
+ - **タグタイプテスト**(`Tags` describe ブロック)— `nodeName` アサーションを更新
78
+ - **ノードリストテスト**(`Node list` describe ブロック)— デバッグマップスナップショット内の `#ps:*` エントリを更新
79
+ 4. ビルド: `yarn build --scope @markuplint/ejs-parser`
80
+ 5. テスト: `yarn test --scope @markuplint/ejs-parser`
81
+
82
+ ## 下流への影響
83
+
84
+ このパッケージはリーフパーサーであり、他のパッケージはこれに依存していません。`@markuplint/ejs-parser` への変更は、下流パッケージのテストを必要としません。
@@ -0,0 +1,84 @@
1
+ # Maintenance Guide
2
+
3
+ ## Commands
4
+
5
+ | Command | Description |
6
+ | ------------------------------------------- | ---------------------- |
7
+ | `yarn build --scope @markuplint/ejs-parser` | Build this package |
8
+ | `yarn dev --scope @markuplint/ejs-parser` | Watch mode build |
9
+ | `yarn clean --scope @markuplint/ejs-parser` | Remove build artifacts |
10
+ | `yarn test --scope @markuplint/ejs-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` | EJSParser integration tests (node list structure, tag type detection, etc.) |
19
+
20
+ The primary testing pattern uses `nodeListToDebugMaps` for snapshot-style assertions:
21
+
22
+ ```ts
23
+ import { nodeListToDebugMaps } from '@markuplint/parser-utils';
24
+ import { parser } from './parser.js';
25
+
26
+ const doc = parser.parse('<div><%= value %></div>');
27
+ expect(nodeListToDebugMaps(doc.nodeList)).toStrictEqual([
28
+ '[1:1]>[1:6](0,5)div: <div>',
29
+ '[1:6]>[1:18](5,17)#ps:ejs-output-value: <%=␣value␣%>',
30
+ '[1:18]>[1:24](17,23)div: </div>',
31
+ ]);
32
+ ```
33
+
34
+ Tag type detection tests verify that each EJS variant produces the correct `#ps:*` node name:
35
+
36
+ ```ts
37
+ expect(parse('<%_ any _%>').nodeList[0].nodeName).toBe('#ps:ejs-whitespace-slurping');
38
+ expect(parse('<%= any %>').nodeList[0].nodeName).toBe('#ps:ejs-output-value');
39
+ expect(parse('<%- any -%>').nodeList[0].nodeName).toBe('#ps:ejs-output-unescaped');
40
+ expect(parse('<%# any %>').nodeList[0].nodeName).toBe('#ps:ejs-comment');
41
+ expect(parse('<% any %>').nodeList[0].nodeName).toBe('#ps:ejs-scriptlet');
42
+ ```
43
+
44
+ ## Recipes
45
+
46
+ ### 1. Adding an ignoreTags Pattern
47
+
48
+ When a new EJS tag variant needs to be supported:
49
+
50
+ 1. Open `src/parser.ts`
51
+ 2. Add a new entry to the `ignoreTags` array in the constructor:
52
+ ```ts
53
+ {
54
+ type: 'ejs-new-variant',
55
+ start: '<%X',
56
+ end: '%>',
57
+ },
58
+ ```
59
+ 3. **Ordering matters** — Place the new entry before `ejs-scriptlet`. The `ejs-scriptlet` pattern uses a catch-all regex (`/<%(?!%)/`) and must remain last to avoid matching more specific patterns
60
+ 4. Add a tag detection test in `src/index.spec.ts`:
61
+ ```ts
62
+ test('ejs-new-variant', () => {
63
+ expect(parse('<%X any %>').nodeList[0].nodeName).toBe('#ps:ejs-new-variant');
64
+ });
65
+ ```
66
+ 5. Add a node list integration test if the new variant has special parsing behavior
67
+ 6. Build: `yarn build --scope @markuplint/ejs-parser`
68
+ 7. Test: `yarn test --scope @markuplint/ejs-parser`
69
+
70
+ ### 2. Modifying an ignoreTags Pattern
71
+
72
+ When changing a start/end delimiter or renaming a type:
73
+
74
+ 1. Open `src/parser.ts` and find the target entry in `ignoreTags`
75
+ 2. Modify the `type`, `start`, or `end` fields as needed
76
+ 3. Update all affected tests in `src/index.spec.ts`:
77
+ - **Tag type tests** (`Tags` describe block) — update the `nodeName` assertions
78
+ - **Node list tests** (`Node list` describe block) — update the `#ps:*` entries in debug map snapshots
79
+ 4. Build: `yarn build --scope @markuplint/ejs-parser`
80
+ 5. Test: `yarn test --scope @markuplint/ejs-parser`
81
+
82
+ ## Downstream Impact
83
+
84
+ This package is a leaf parser — no other packages depend on it. Changes to `@markuplint/ejs-parser` do not require testing downstream packages.
package/lib/index.d.ts CHANGED
@@ -1 +1,7 @@
1
+ /**
2
+ * @module @markuplint/ejs-parser
3
+ * Markuplint parser plugin for EJS (Embedded JavaScript) templates. Extends the
4
+ * standard HTML parser to treat EJS tags as opaque blocks, allowing markuplint
5
+ * 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/ejs-parser
3
+ * Markuplint parser plugin for EJS (Embedded JavaScript) templates. Extends the
4
+ * standard HTML parser to treat EJS tags as opaque blocks, allowing markuplint
5
+ * to lint the surrounding HTML structure.
6
+ */
1
7
  export { parser } from './parser.js';
package/lib/parser.d.ts CHANGED
@@ -1,6 +1,19 @@
1
1
  import { HtmlParser } from '@markuplint/html-parser';
2
+ /**
3
+ * Parser for EJS (Embedded JavaScript) templates that extends the standard HTML parser.
4
+ *
5
+ * Configures the HTML parser to recognize all EJS tag variants as opaque blocks:
6
+ * - `<%_ ... %>` (whitespace-slurping scriptlets)
7
+ * - `<%= ... %>` (escaped output)
8
+ * - `<%- ... %>` (unescaped output)
9
+ * - `<%# ... %>` (comments)
10
+ * - `<% ... %>` (plain scriptlets)
11
+ */
2
12
  declare class EJSParser extends HtmlParser {
3
13
  constructor();
4
14
  }
15
+ /**
16
+ * Singleton EJS parser instance for use by the markuplint engine.
17
+ */
5
18
  export declare const parser: EJSParser;
6
19
  export {};
package/lib/parser.js CHANGED
@@ -1,4 +1,14 @@
1
1
  import { HtmlParser } from '@markuplint/html-parser';
2
+ /**
3
+ * Parser for EJS (Embedded JavaScript) templates that extends the standard HTML parser.
4
+ *
5
+ * Configures the HTML parser to recognize all EJS tag variants as opaque blocks:
6
+ * - `<%_ ... %>` (whitespace-slurping scriptlets)
7
+ * - `<%= ... %>` (escaped output)
8
+ * - `<%- ... %>` (unescaped output)
9
+ * - `<%# ... %>` (comments)
10
+ * - `<% ... %>` (plain scriptlets)
11
+ */
2
12
  class EJSParser extends HtmlParser {
3
13
  constructor() {
4
14
  super({
@@ -32,4 +42,7 @@ class EJSParser extends HtmlParser {
32
42
  });
33
43
  }
34
44
  }
45
+ /**
46
+ * Singleton EJS parser instance for use by the markuplint engine.
47
+ */
35
48
  export const parser = new EJSParser();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/ejs-parser",
3
- "version": "4.6.22",
3
+ "version": "4.18.0",
4
4
  "description": "EJS 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.22"
24
+ "@markuplint/html-parser": "4.18.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@markuplint/parser-utils": "4.8.10"
27
+ "@markuplint/parser-utils": "4.18.0"
28
28
  },
29
- "gitHead": "6213ea30269ef404f030e67bbcc7fc7443ec1060"
29
+ "gitHead": "1885af6349def3f19df975b9e9c399dd47361de1"
30
30
  }