@willbooster/tree-sitter-html 4.0.0 → 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 +5 -4
- package/grammar.js +3 -2
- package/package.json +3 -3
- package/tree-sitter-html.wasm +0 -0
- package/tree-sitter.json +1 -1
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
|
|
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
|
|
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 = "
|
|
101
|
-
tree-sitter-html = { package = "willbooster-tree-sitter-html", version = "
|
|
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,
|
|
@@ -80,7 +81,7 @@ module.exports = grammar({
|
|
|
80
81
|
style_element: $ => seq(
|
|
81
82
|
alias($.style_start_tag, $.start_tag),
|
|
82
83
|
optional($.raw_text),
|
|
83
|
-
$.end_tag,
|
|
84
|
+
choice($.end_tag, $._implicit_end_tag),
|
|
84
85
|
),
|
|
85
86
|
|
|
86
87
|
start_tag: $ => seq(
|
|
@@ -164,6 +165,6 @@ module.exports = grammar({
|
|
|
164
165
|
)), $.attribute_value)), '"'),
|
|
165
166
|
),
|
|
166
167
|
|
|
167
|
-
text: _ => token
|
|
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": "
|
|
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": "
|
|
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": "^
|
|
63
|
+
"@willbooster/web-tree-sitter": "^7.0.5"
|
|
64
64
|
},
|
|
65
65
|
"peerDependenciesMeta": {
|
|
66
66
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-html.wasm
CHANGED
|
Binary file
|