@willbooster/tree-sitter-html 12.0.0 → 14.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 +9 -15
- package/package.json +5 -5
- package/tree-sitter-html.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/WillBooster/tree-sitter-html/actions/workflows/test.yml)
|
|
6
6
|
[](https://github.com/WillBooster/tree-sitter-html/actions/workflows/test-rust.yml)
|
|
7
7
|
[](https://github.com/semantic-release/semantic-release)
|
|
8
|
-
[](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
|
|
9
9
|
[](https://crates.io/crates/willbooster-tree-sitter-html)
|
|
10
10
|
|
|
11
11
|
HTML grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
|
@@ -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 `0x5742000c`, so it loads with the WillBooster runtime, version 17.0.1 or later in the 17.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
|
|
@@ -47,11 +47,6 @@ and processing instructions are siblings, and explicit void-element end tags are
|
|
|
47
47
|
In SVG/MathML content outside HTML integration points, HTML breakout start tags such as `<p>` and `<span>` implicitly
|
|
48
48
|
close the foreign ancestors. The same applies to `<font>` with a `color`, `face`, or `size` attribute and to `</br>` or
|
|
49
49
|
`</p>`. Later end tags for those foreign ancestors become `erroneous_end_tag` nodes.
|
|
50
|
-
Scanner serialization stores the open-tag stack from its innermost tag, compressing runs of identical tags, so active
|
|
51
|
-
script and style elements retain their identities when deeply nested. When distinct tags exceed the fixed-size
|
|
52
|
-
buffer, serialization prioritizes inner tags and outer namespace boundaries, replacing ordinary outer tags with unknown
|
|
53
|
-
runs. Custom tag names are retained in full when they fit the remaining buffer. Names that exceed the buffer are
|
|
54
|
-
omitted along with older tags. Lost tag identities can still produce recovery errors when those tags close.
|
|
55
50
|
Malformed input after a void element can replace its enclosing element with an `ERROR` node during recovery.
|
|
56
51
|
|
|
57
52
|
Attribute values use distinct `unquoted_attribute_value`, `singlequoted_attribute_value`, and
|
|
@@ -68,14 +63,14 @@ the value, so `noval= bool` remains one attribute with the unquoted value `bool`
|
|
|
68
63
|
## Support Scope
|
|
69
64
|
|
|
70
65
|
This fork maintains only full parsing: valid input yields a correct tree, and invalid input yields `ERROR` or `MISSING`
|
|
71
|
-
nodes without crashing, hanging, or taking more than linear time. Incremental parsing
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
nodes without crashing, hanging, or taking more than linear time. Incremental parsing and reuse of an earlier tree are
|
|
67
|
+
unsupported. No queries (highlights, locals, injections, tags) are shipped. Node types, field names, and the trees that
|
|
68
|
+
error recovery produces may change; such changes are released as new major versions.
|
|
74
69
|
|
|
75
70
|
## Usage
|
|
76
71
|
|
|
77
72
|
The npm package ships `tree-sitter-html.wasm` for
|
|
78
|
-
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version
|
|
73
|
+
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 17.0.1 or later in the 17.x series, which runs in Node.js, Bun, browsers, and Cloudflare Workers.
|
|
79
74
|
In Node.js and Bun, load the grammar from its path:
|
|
80
75
|
|
|
81
76
|
```js
|
|
@@ -121,10 +116,9 @@ In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-
|
|
|
121
116
|
[willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
|
|
122
117
|
fuzzed with:
|
|
123
118
|
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
tree-sitter-html = { package = "willbooster-tree-sitter-html", version = "12" }
|
|
119
|
+
```sh
|
|
120
|
+
cargo add willbooster-tree-sitter@17.0.1 --rename tree-sitter
|
|
121
|
+
cargo add willbooster-tree-sitter-html --rename tree-sitter-html
|
|
128
122
|
```
|
|
129
123
|
|
|
130
124
|
```rust
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-html",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "HTML grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"html",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@types/bun": "1.4.4",
|
|
49
49
|
"@vitest/browser-playwright": "5.0.5",
|
|
50
50
|
"@willbooster/oxlint-config": "1.4.9",
|
|
51
|
-
"@willbooster/wb": "23.0.
|
|
52
|
-
"@willbooster/web-tree-sitter": "
|
|
51
|
+
"@willbooster/wb": "23.0.2",
|
|
52
|
+
"@willbooster/web-tree-sitter": "17.0.1",
|
|
53
53
|
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
54
54
|
"lefthook": "2.2.2",
|
|
55
55
|
"oxlint": "1.89.0",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"playwright": "1.64.1",
|
|
58
58
|
"semantic-release": "25.0.9",
|
|
59
59
|
"vitest": "5.0.5",
|
|
60
|
-
"wrangler": "4.
|
|
60
|
+
"wrangler": "4.152.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@willbooster/web-tree-sitter": "^
|
|
63
|
+
"@willbooster/web-tree-sitter": "^17.0.1"
|
|
64
64
|
},
|
|
65
65
|
"peerDependenciesMeta": {
|
|
66
66
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-html.wasm
CHANGED
|
Binary file
|