@willbooster/tree-sitter-html 4.0.1 → 5.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/README.md CHANGED
@@ -14,7 +14,7 @@ to its authors and contributors. This is not an official release of that project
14
14
 
15
15
  This fork is based on upstream's version 0.23.2 grammar and external scanner and generates the parser with the
16
16
  [WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter) generator. The parser carries that fork's own ABI
17
- number, so it loads only with the WillBooster runtime, version 2.x
17
+ number `0x57420006`, so it loads with the WillBooster runtime, version 7.0.5 or later in the 7.x series
18
18
  ([willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter),
19
19
  [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter)); upstream's runtime rejects
20
20
  it. Input that contains NUL characters can parse to a different tree than with upstream's 0.23.2 parser, because the
@@ -51,7 +51,8 @@ between attributes. Comment-shaped text inside a quoted value remains part of th
51
51
  ## Usage
52
52
 
53
53
  The npm package ships `tree-sitter-html.wasm` for
54
- [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 2.x, which runs in Node.js, Bun, browsers, and Cloudflare Workers. In Node.js and Bun, load the grammar from its path:
54
+ [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 7.0.5 or later in the 7.x series, which runs in Node.js, Bun, browsers, and Cloudflare Workers.
55
+ In Node.js and Bun, load the grammar from its path:
55
56
 
56
57
  ```js
57
58
  import { fileURLToPath } from 'node:url';
@@ -97,8 +98,8 @@ fuzzed with:
97
98
 
98
99
  ```toml
99
100
  [dependencies]
100
- tree-sitter = { package = "willbooster-tree-sitter", version = "2.0.0" }
101
- tree-sitter-html = { package = "willbooster-tree-sitter-html", version = "4" }
101
+ tree-sitter = { package = "willbooster-tree-sitter", version = "7.0.5" }
102
+ tree-sitter-html = { package = "willbooster-tree-sitter-html", version = "5" }
102
103
  ```
103
104
 
104
105
  ```rust
package/grammar.js CHANGED
@@ -56,6 +56,7 @@ module.exports = grammar({
56
56
  $.comment,
57
57
  $.entity,
58
58
  $.text,
59
+ alias('&', $.text),
59
60
  $.element,
60
61
  $.script_element,
61
62
  $.style_element,
@@ -164,6 +165,6 @@ module.exports = grammar({
164
165
  )), $.attribute_value)), '"'),
165
166
  ),
166
167
 
167
- text: _ => token.immediate(/[^<&]+|&/),
168
+ text: _ => token(prec(1, /[^<&]+/)),
168
169
  },
169
170
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-html",
3
- "version": "4.0.1",
3
+ "version": "5.0.0",
4
4
  "description": "HTML grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -47,7 +47,7 @@
47
47
  "@willbooster/oxfmt-config": "1.2.2",
48
48
  "@willbooster/oxlint-config": "1.4.8",
49
49
  "@willbooster/wb": "22.26.1",
50
- "@willbooster/web-tree-sitter": "2.0.27",
50
+ "@willbooster/web-tree-sitter": "7.0.5",
51
51
  "conventional-changelog-conventionalcommits": "10.4.1",
52
52
  "lefthook": "2.2.1",
53
53
  "oxfmt": "0.72.0",
@@ -60,7 +60,7 @@
60
60
  "wrangler": "4.149.0"
61
61
  },
62
62
  "peerDependencies": {
63
- "@willbooster/web-tree-sitter": "^2.0.0"
63
+ "@willbooster/web-tree-sitter": "^7.0.5"
64
64
  },
65
65
  "peerDependenciesMeta": {
66
66
  "@willbooster/web-tree-sitter": {
Binary file
package/tree-sitter.json CHANGED
@@ -20,7 +20,7 @@
20
20
  }
21
21
  ],
22
22
  "metadata": {
23
- "version": "4.0.1",
23
+ "version": "5.0.0",
24
24
  "license": "MIT",
25
25
  "description": "HTML grammar for tree-sitter",
26
26
  "authors": [