@willbooster/tree-sitter-html 0.0.0-stage → 1.0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Max Brunsfeld
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,132 @@
1
- # Temporary Holding Version
1
+ # @willbooster/tree-sitter-html
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![Test](https://github.com/WillBooster/tree-sitter-html/actions/workflows/test.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-html/actions/workflows/test.yml)
4
+ [![Test rust](https://github.com/WillBooster/tree-sitter-html/actions/workflows/test-rust.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-html/actions/workflows/test-rust.yml)
5
+ [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
6
+ [![wbfy](https://img.shields.io/badge/wbfy-20.36.11-1e90ff.svg)](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
7
+ [![crates.io](https://img.shields.io/crates/v/willbooster-tree-sitter-html.svg)](https://crates.io/crates/willbooster-tree-sitter-html)
8
+
9
+ HTML grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
10
+ [tree-sitter/tree-sitter-html](https://github.com/tree-sitter/tree-sitter-html). We are grateful
11
+ to its authors and contributors. This is not an official release of that project.
12
+
13
+ This fork keeps the grammar and the external scanner of upstream's version 0.23.2 and generates the parser with the
14
+ [WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter) generator. The parser carries that fork's own ABI
15
+ number, so it loads only with the WillBooster runtime, version 2.0.0 or later
16
+ ([willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter),
17
+ [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter)); upstream's runtime rejects
18
+ it. Input that contains NUL characters can parse to a different tree than with upstream's 0.23.2 parser, because the
19
+ lexers that generator emits treat a NUL character as an ordinary character; other input parses to the same tree.
20
+
21
+ ## Usage
22
+
23
+ The npm package ships `tree-sitter-html.wasm` for
24
+ [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 2.0.0 or later, which runs in Node.js, Bun, browsers, and Cloudflare Workers. In Node.js and Bun, load the grammar from its path:
25
+
26
+ ```js
27
+ import { fileURLToPath } from 'node:url';
28
+ import { Language, Parser } from '@willbooster/web-tree-sitter';
29
+
30
+ await Parser.init();
31
+ const parser = new Parser();
32
+ const wasmPath = fileURLToPath(import.meta.resolve('@willbooster/tree-sitter-html/tree-sitter-html.wasm'));
33
+ parser.setLanguage(await Language.load(wasmPath));
34
+ const tree = parser.parse('<!DOCTYPE html>\n<p>Hello</p>\n');
35
+ ```
36
+
37
+ In browsers, serve both `.wasm` files and load them by URL (the example uses Vite's `?url` imports):
38
+
39
+ ```js
40
+ import { Language, Parser } from '@willbooster/web-tree-sitter';
41
+ import runtimeUrl from '@willbooster/web-tree-sitter/web-tree-sitter.wasm?url';
42
+ import htmlUrl from '@willbooster/tree-sitter-html/tree-sitter-html.wasm?url';
43
+
44
+ await Parser.init({ locateFile: () => runtimeUrl });
45
+ const parser = new Parser();
46
+ parser.setLanguage(await Language.load(htmlUrl));
47
+ ```
48
+
49
+ Cloudflare Workers do not allow compiling Wasm at run time, so import both `.wasm` files as modules, with or without
50
+ Node.js compatibility:
51
+
52
+ ```js
53
+ import { Language, Parser } from '@willbooster/web-tree-sitter';
54
+ import runtime from '@willbooster/web-tree-sitter/web-tree-sitter.wasm';
55
+ import html from '@willbooster/tree-sitter-html/tree-sitter-html.wasm';
56
+
57
+ await Parser.init({ wasmModule: runtime });
58
+ const parser = new Parser();
59
+ parser.setLanguage(await Language.load(html));
60
+ ```
61
+
62
+ The package also ships `grammar.js`, the queries in `queries/`, and the node types in `src/node-types.json`.
63
+
64
+ In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-html) and on
65
+ [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
66
+ fuzzed with:
67
+
68
+ ```toml
69
+ [dependencies]
70
+ tree-sitter = { package = "willbooster-tree-sitter", version = "2.0.0" }
71
+ tree-sitter-html = { package = "willbooster-tree-sitter-html", version = "1" }
72
+ ```
73
+
74
+ ```rust
75
+ let mut parser = tree_sitter::Parser::new();
76
+ parser.set_language(&tree_sitter_html::LANGUAGE.into())?;
77
+ ```
78
+
79
+ ## Development
80
+
81
+ ```sh
82
+ mise install
83
+ bun install --frozen-lockfile
84
+ bun run test/ci-setup # installs Chromium for the browser test
85
+ bun run build/ci
86
+ bun run test
87
+ script/parse-examples
88
+ cargo test
89
+ ```
90
+
91
+ The scripts and tests generate, build, test, and parse with `script/tree-sitter`, the tree-sitter CLI of the
92
+ WillBooster/tree-sitter runtime version locked in `Cargo.lock`, since the generator and the runtime of upstream's CLI are
93
+ not the ones this package ships with. Its first run downloads that CLI from the runtime's GitHub Release, or builds it
94
+ with `cargo` (whose build runs the CMake that `mise.toml` pins) when the download fails or the release has no binary that runs here. Run other CLI commands through it as
95
+ well (e.g. `script/tree-sitter parse file.html`).
96
+
97
+ `bun run generate` records a fresh generation profile from the applicable `test/corpus` cases and Git-tracked
98
+ files in `examples/`, then generates compact parser tables. The parser also embeds metadata from `tree-sitter.json`. After changing a grammar,
99
+ `tree-sitter.json`, a corpus case, or a tracked example,
100
+ regenerate and commit `src/`. Stage added or removed examples with `git add -A examples` before generation so the profile uses the intended file list.
101
+ Profiles in `.tmp/generation-profiles/` are temporary and must not be committed. `bun run build-wasm`, `bun run build/ci`,
102
+ and the release build regenerate the parsers before compiling them.
103
+
104
+ `bun run test` runs:
105
+
106
+ - the corpus in `test/corpus`, with the native build and with the Wasm build (the first run downloads the WASI SDK);
107
+ - an incremental-parsing check (`test/unit/incremental.test.ts`): `script/fuzz-corpus` runs `tree-sitter fuzz`, which
108
+ edits each corpus case at random, reparses it, undoes the edits, and reparses again. `TREE_SITTER_SEED`,
109
+ `TREE_SITTER_ITERATIONS`, and `TREE_SITTER_EDITS` run other or more edits;
110
+ - a check that the real-world HTML files in `examples/`, the checked-in ones and those of the cloned repositories, fail
111
+ to parse exactly as listed in `script/known-failures.txt`. The first run clones the repositories. The example repositories are pinned to commits in
112
+ `script/parse-examples`. After a grammar change or a moved pin alters that list, `script/parse-examples` rewrites it;
113
+ review its diff before committing;
114
+ - a performance check (`test/unit/performance.test.ts`) that recovering from an error on each line takes linear
115
+ time, since consumers parse files while they are being edited. It loads the Wasm build through
116
+ @willbooster/web-tree-sitter, which `bun run build/ci` rebuilds after regenerating the parser;
117
+ - a check (`test/unit/runtimeVersion.test.ts`) that `@willbooster/web-tree-sitter` in `package.json` and
118
+ `willbooster-tree-sitter` in `Cargo.lock` are the same version, since the Wasm tests run on the former and the Rust
119
+ tests, the fuzzer, and the CLI on the latter;
120
+ - tests that load the Wasm build with @willbooster/web-tree-sitter in Chromium (`test/e2e/browser.test.ts`) and in
121
+ Cloudflare Workers with and without Node.js compatibility (`test/e2e/workers.test.ts`).
122
+
123
+ The tests and `script/parse-examples` compile the parser into `.tmp/tree-sitter-lib` rather than the CLI's cache shared
124
+ by every checkout; `script/fuzz-corpus` builds a parser of its own in `.tmp/fuzz` for each run and deletes it
125
+ afterwards.
126
+
127
+ CI also runs these tests on Linux arm64 and macOS, where the CLI compiles the parser and the scanner natively, and fuzzes
128
+ both with libFuzzer and sanitizers (`.github/workflows/robustness.yml`).
129
+
130
+ ### References
131
+
132
+ - [The HTML Standard](https://html.spec.whatwg.org/multipage/)
package/grammar.js ADDED
@@ -0,0 +1,141 @@
1
+ /**
2
+ * @file HTML grammar for tree-sitter
3
+ * @author Max Brunsfeld <maxbrunsfeld@gmail.com>
4
+ * @author Amaan Qureshi <amaanq12@gmail.com>
5
+ * @license MIT
6
+ */
7
+
8
+ /// <reference types="tree-sitter-cli/dsl" />
9
+ // @ts-check
10
+
11
+ module.exports = grammar({
12
+ name: 'html',
13
+
14
+ extras: $ => [
15
+ $.comment,
16
+ /\s+/,
17
+ ],
18
+
19
+ externals: $ => [
20
+ $._start_tag_name,
21
+ $._script_start_tag_name,
22
+ $._style_start_tag_name,
23
+ $._end_tag_name,
24
+ $.erroneous_end_tag_name,
25
+ '/>',
26
+ $._implicit_end_tag,
27
+ $.raw_text,
28
+ $.comment,
29
+ ],
30
+
31
+ rules: {
32
+ document: $ => repeat($._node),
33
+
34
+ doctype: $ => seq(
35
+ '<!',
36
+ alias($._doctype, 'doctype'),
37
+ /[^>]+/,
38
+ '>',
39
+ ),
40
+
41
+ _doctype: _ => /[Dd][Oo][Cc][Tt][Yy][Pp][Ee]/,
42
+
43
+ _node: $ => choice(
44
+ $.doctype,
45
+ $.entity,
46
+ $.text,
47
+ $.element,
48
+ $.script_element,
49
+ $.style_element,
50
+ $.erroneous_end_tag,
51
+ ),
52
+
53
+ element: $ => choice(
54
+ seq(
55
+ $.start_tag,
56
+ repeat($._node),
57
+ choice($.end_tag, $._implicit_end_tag),
58
+ ),
59
+ $.self_closing_tag,
60
+ ),
61
+
62
+ script_element: $ => seq(
63
+ alias($.script_start_tag, $.start_tag),
64
+ optional($.raw_text),
65
+ $.end_tag,
66
+ ),
67
+
68
+ style_element: $ => seq(
69
+ alias($.style_start_tag, $.start_tag),
70
+ optional($.raw_text),
71
+ $.end_tag,
72
+ ),
73
+
74
+ start_tag: $ => seq(
75
+ '<',
76
+ alias($._start_tag_name, $.tag_name),
77
+ repeat($.attribute),
78
+ '>',
79
+ ),
80
+
81
+ script_start_tag: $ => seq(
82
+ '<',
83
+ alias($._script_start_tag_name, $.tag_name),
84
+ repeat($.attribute),
85
+ '>',
86
+ ),
87
+
88
+ style_start_tag: $ => seq(
89
+ '<',
90
+ alias($._style_start_tag_name, $.tag_name),
91
+ repeat($.attribute),
92
+ '>',
93
+ ),
94
+
95
+ self_closing_tag: $ => seq(
96
+ '<',
97
+ alias($._start_tag_name, $.tag_name),
98
+ repeat($.attribute),
99
+ '/>',
100
+ ),
101
+
102
+ end_tag: $ => seq(
103
+ '</',
104
+ alias($._end_tag_name, $.tag_name),
105
+ '>',
106
+ ),
107
+
108
+ erroneous_end_tag: $ => seq(
109
+ '</',
110
+ $.erroneous_end_tag_name,
111
+ '>',
112
+ ),
113
+
114
+ attribute: $ => seq(
115
+ $.attribute_name,
116
+ optional(seq(
117
+ '=',
118
+ choice(
119
+ $.attribute_value,
120
+ $.quoted_attribute_value,
121
+ ),
122
+ )),
123
+ ),
124
+
125
+ attribute_name: _ => /[^<>"'/=\s]+/,
126
+
127
+ attribute_value: _ => /[^<>"'=\s]+/,
128
+
129
+ // An entity can be named, numeric (decimal), or numeric (hexacecimal). The
130
+ // longest entity name is 29 characters long, and the HTML spec says that
131
+ // no more will ever be added.
132
+ entity: _ => /&(#([xX][0-9a-fA-F]{1,6}|[0-9]{1,5})|[A-Za-z]{1,30});?/,
133
+
134
+ quoted_attribute_value: $ => choice(
135
+ seq('\'', optional(alias(/[^']+/, $.attribute_value)), '\''),
136
+ seq('"', optional(alias(/[^"]+/, $.attribute_value)), '"'),
137
+ ),
138
+
139
+ text: _ => /[^<>&\s]([^<>&]*[^<>&\s])?/,
140
+ },
141
+ });
package/package.json CHANGED
@@ -1,6 +1,75 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-html",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "HTML grammar for tree-sitter",
5
+ "keywords": [
6
+ "incremental",
7
+ "parsing",
8
+ "tree-sitter",
9
+ "html"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/WillBooster/tree-sitter-html.git"
14
+ },
15
+ "license": "MIT",
16
+ "author": "WillBooster Inc.",
17
+ "files": [
18
+ "grammar.js",
19
+ "queries/*.scm",
20
+ "src/node-types.json",
21
+ "tree-sitter.json",
22
+ "*.wasm"
23
+ ],
24
+ "scripts": {
25
+ "build-wasm": "script/generate --build-wasm",
26
+ "build/ci": "bun run build-wasm",
27
+ "cleanup": "bun wb lint --fix --format",
28
+ "format": "bun wb lint --format",
29
+ "generate": "script/generate",
30
+ "lint": "bun wb lint",
31
+ "lint-fix": "bun wb lint --fix",
32
+ "prepare": "(bun lefthook install || true) && (test ! -f .lefthook/normalize-bun-lockfile.sh || bash .lefthook/normalize-bun-lockfile.sh)",
33
+ "release": "wb release",
34
+ "prestart": "bun run build-wasm",
35
+ "start": "script/tree-sitter playground",
36
+ "test": "bun wb test",
37
+ "test/ci": "bun wb test-on-ci",
38
+ "test/ci-setup": "playwright install --with-deps chromium",
39
+ "typecheck": "bun wb typecheck",
40
+ "verify": "bun wb verify",
41
+ "verify-full": "bun wb verify --full"
42
+ },
43
+ "devDependencies": {
44
+ "@tsconfig/bun": "1.0.11",
45
+ "@types/bun": "1.4.2",
46
+ "@vitest/browser-playwright": "5.0.3",
47
+ "@willbooster/oxfmt-config": "1.2.2",
48
+ "@willbooster/oxlint-config": "1.4.8",
49
+ "@willbooster/wb": "22.24.0",
50
+ "@willbooster/web-tree-sitter": "2.0.1",
51
+ "conventional-changelog-conventionalcommits": "10.4.0",
52
+ "lefthook": "2.1.16",
53
+ "oxfmt": "0.71.0",
54
+ "oxlint": "1.86.0",
55
+ "oxlint-tsgolint": "7.0.2003",
56
+ "playwright": "1.63.0",
57
+ "semantic-release": "25.0.9",
58
+ "sort-package-json": "4.0.0",
59
+ "typescript": "7.0.2",
60
+ "vitest": "5.0.3",
61
+ "wrangler": "4.147.0"
62
+ },
63
+ "peerDependencies": {
64
+ "@willbooster/web-tree-sitter": "^2.0.0"
65
+ },
66
+ "peerDependenciesMeta": {
67
+ "@willbooster/web-tree-sitter": {
68
+ "optional": true
69
+ }
70
+ },
71
+ "publishConfig": {
72
+ "access": "public",
73
+ "registry": "https://registry.npmjs.org/"
74
+ }
75
+ }
@@ -0,0 +1,13 @@
1
+ (tag_name) @tag
2
+ (erroneous_end_tag_name) @tag.error
3
+ (doctype) @constant
4
+ (attribute_name) @attribute
5
+ (attribute_value) @string
6
+ (comment) @comment
7
+
8
+ [
9
+ "<"
10
+ ">"
11
+ "</"
12
+ "/>"
13
+ ] @punctuation.bracket
@@ -0,0 +1,7 @@
1
+ ((script_element
2
+ (raw_text) @injection.content)
3
+ (#set! injection.language "javascript"))
4
+
5
+ ((style_element
6
+ (raw_text) @injection.content)
7
+ (#set! injection.language "css"))
@@ -0,0 +1,319 @@
1
+ [
2
+ {
3
+ "type": "attribute",
4
+ "named": true,
5
+ "fields": {},
6
+ "children": {
7
+ "multiple": true,
8
+ "required": true,
9
+ "types": [
10
+ {
11
+ "type": "attribute_name",
12
+ "named": true
13
+ },
14
+ {
15
+ "type": "attribute_value",
16
+ "named": true
17
+ },
18
+ {
19
+ "type": "quoted_attribute_value",
20
+ "named": true
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "type": "doctype",
27
+ "named": true,
28
+ "fields": {}
29
+ },
30
+ {
31
+ "type": "document",
32
+ "named": true,
33
+ "root": true,
34
+ "fields": {},
35
+ "children": {
36
+ "multiple": true,
37
+ "required": false,
38
+ "types": [
39
+ {
40
+ "type": "doctype",
41
+ "named": true
42
+ },
43
+ {
44
+ "type": "element",
45
+ "named": true
46
+ },
47
+ {
48
+ "type": "entity",
49
+ "named": true
50
+ },
51
+ {
52
+ "type": "erroneous_end_tag",
53
+ "named": true
54
+ },
55
+ {
56
+ "type": "script_element",
57
+ "named": true
58
+ },
59
+ {
60
+ "type": "style_element",
61
+ "named": true
62
+ },
63
+ {
64
+ "type": "text",
65
+ "named": true
66
+ }
67
+ ]
68
+ }
69
+ },
70
+ {
71
+ "type": "element",
72
+ "named": true,
73
+ "fields": {},
74
+ "children": {
75
+ "multiple": true,
76
+ "required": true,
77
+ "types": [
78
+ {
79
+ "type": "doctype",
80
+ "named": true
81
+ },
82
+ {
83
+ "type": "element",
84
+ "named": true
85
+ },
86
+ {
87
+ "type": "end_tag",
88
+ "named": true
89
+ },
90
+ {
91
+ "type": "entity",
92
+ "named": true
93
+ },
94
+ {
95
+ "type": "erroneous_end_tag",
96
+ "named": true
97
+ },
98
+ {
99
+ "type": "script_element",
100
+ "named": true
101
+ },
102
+ {
103
+ "type": "self_closing_tag",
104
+ "named": true
105
+ },
106
+ {
107
+ "type": "start_tag",
108
+ "named": true
109
+ },
110
+ {
111
+ "type": "style_element",
112
+ "named": true
113
+ },
114
+ {
115
+ "type": "text",
116
+ "named": true
117
+ }
118
+ ]
119
+ }
120
+ },
121
+ {
122
+ "type": "end_tag",
123
+ "named": true,
124
+ "fields": {},
125
+ "children": {
126
+ "multiple": false,
127
+ "required": true,
128
+ "types": [
129
+ {
130
+ "type": "tag_name",
131
+ "named": true
132
+ }
133
+ ]
134
+ }
135
+ },
136
+ {
137
+ "type": "erroneous_end_tag",
138
+ "named": true,
139
+ "fields": {},
140
+ "children": {
141
+ "multiple": false,
142
+ "required": true,
143
+ "types": [
144
+ {
145
+ "type": "erroneous_end_tag_name",
146
+ "named": true
147
+ }
148
+ ]
149
+ }
150
+ },
151
+ {
152
+ "type": "quoted_attribute_value",
153
+ "named": true,
154
+ "fields": {},
155
+ "children": {
156
+ "multiple": false,
157
+ "required": false,
158
+ "types": [
159
+ {
160
+ "type": "attribute_value",
161
+ "named": true
162
+ }
163
+ ]
164
+ }
165
+ },
166
+ {
167
+ "type": "script_element",
168
+ "named": true,
169
+ "fields": {},
170
+ "children": {
171
+ "multiple": true,
172
+ "required": true,
173
+ "types": [
174
+ {
175
+ "type": "end_tag",
176
+ "named": true
177
+ },
178
+ {
179
+ "type": "raw_text",
180
+ "named": true
181
+ },
182
+ {
183
+ "type": "start_tag",
184
+ "named": true
185
+ }
186
+ ]
187
+ }
188
+ },
189
+ {
190
+ "type": "self_closing_tag",
191
+ "named": true,
192
+ "fields": {},
193
+ "children": {
194
+ "multiple": true,
195
+ "required": true,
196
+ "types": [
197
+ {
198
+ "type": "attribute",
199
+ "named": true
200
+ },
201
+ {
202
+ "type": "tag_name",
203
+ "named": true
204
+ }
205
+ ]
206
+ }
207
+ },
208
+ {
209
+ "type": "start_tag",
210
+ "named": true,
211
+ "fields": {},
212
+ "children": {
213
+ "multiple": true,
214
+ "required": true,
215
+ "types": [
216
+ {
217
+ "type": "attribute",
218
+ "named": true
219
+ },
220
+ {
221
+ "type": "tag_name",
222
+ "named": true
223
+ }
224
+ ]
225
+ }
226
+ },
227
+ {
228
+ "type": "style_element",
229
+ "named": true,
230
+ "fields": {},
231
+ "children": {
232
+ "multiple": true,
233
+ "required": true,
234
+ "types": [
235
+ {
236
+ "type": "end_tag",
237
+ "named": true
238
+ },
239
+ {
240
+ "type": "raw_text",
241
+ "named": true
242
+ },
243
+ {
244
+ "type": "start_tag",
245
+ "named": true
246
+ }
247
+ ]
248
+ }
249
+ },
250
+ {
251
+ "type": "\"",
252
+ "named": false
253
+ },
254
+ {
255
+ "type": "'",
256
+ "named": false
257
+ },
258
+ {
259
+ "type": "/>",
260
+ "named": false
261
+ },
262
+ {
263
+ "type": "<",
264
+ "named": false
265
+ },
266
+ {
267
+ "type": "<!",
268
+ "named": false
269
+ },
270
+ {
271
+ "type": "</",
272
+ "named": false
273
+ },
274
+ {
275
+ "type": "=",
276
+ "named": false
277
+ },
278
+ {
279
+ "type": ">",
280
+ "named": false
281
+ },
282
+ {
283
+ "type": "attribute_name",
284
+ "named": true
285
+ },
286
+ {
287
+ "type": "attribute_value",
288
+ "named": true
289
+ },
290
+ {
291
+ "type": "comment",
292
+ "named": true,
293
+ "extra": true
294
+ },
295
+ {
296
+ "type": "doctype",
297
+ "named": false
298
+ },
299
+ {
300
+ "type": "entity",
301
+ "named": true
302
+ },
303
+ {
304
+ "type": "erroneous_end_tag_name",
305
+ "named": true
306
+ },
307
+ {
308
+ "type": "raw_text",
309
+ "named": true
310
+ },
311
+ {
312
+ "type": "tag_name",
313
+ "named": true
314
+ },
315
+ {
316
+ "type": "text",
317
+ "named": true
318
+ }
319
+ ]
Binary file
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/config.schema.json",
3
+ "grammars": [
4
+ {
5
+ "name": "html",
6
+ "camelcase": "HTML",
7
+ "scope": "source.html",
8
+ "path": ".",
9
+ "external-files": [
10
+ "src/tag.h"
11
+ ],
12
+ "file-types": [
13
+ "html"
14
+ ],
15
+ "highlights": "queries/highlights.scm",
16
+ "injections": "queries/injections.scm",
17
+ "injection-regex": "html"
18
+ }
19
+ ],
20
+ "metadata": {
21
+ "version": "1.0.0",
22
+ "license": "MIT",
23
+ "description": "HTML grammar for tree-sitter",
24
+ "authors": [
25
+ {
26
+ "name": "WillBooster Inc."
27
+ }
28
+ ],
29
+ "links": {
30
+ "repository": "https://github.com/WillBooster/tree-sitter-html"
31
+ }
32
+ },
33
+ "bindings": {
34
+ "c": false,
35
+ "go": false,
36
+ "java": false,
37
+ "node": false,
38
+ "python": false,
39
+ "rust": true,
40
+ "swift": false,
41
+ "zig": false
42
+ }
43
+ }