@willbooster/tree-sitter-html 7.0.0 → 7.0.2
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 +8 -3
- package/grammar.js +3 -0
- package/package.json +2 -2
- 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
|
|
@@ -29,7 +29,11 @@ and instructions stay `text`, while character references remain `entity` nodes.
|
|
|
29
29
|
`noembed`, and `noframes` also stays `text` up to the element's own closing tag. `plaintext` retains all remaining
|
|
30
30
|
input as `text`, including closing tags. The grammar's scanner requires an HTML tag-name boundary after
|
|
31
31
|
`</script` and `</style`, so longer names and overlapping prefixes remain raw text. Closing-name comparisons
|
|
32
|
-
fold only ASCII letters, and embedded NUL characters remain part of raw-text content.
|
|
32
|
+
fold only ASCII letters, and embedded NUL characters remain part of raw-text content. Tag names start with an ASCII
|
|
33
|
+
letter and retain subsequent characters, including Unicode, until HTML whitespace, `/`, `>`, NUL or end of input.
|
|
34
|
+
Name recognition is independent of platform locale and custom-element registration. NUL retains the existing
|
|
35
|
+
name boundary instead of the HTML tokenizer's replacement-character behavior.
|
|
36
|
+
In the HTML namespace, a trailing
|
|
33
37
|
slash on a `script` or `style` opening tag remains part of its `start_tag`; it does not close the element, so subsequent
|
|
34
38
|
content remains raw text until the matching end tag. Self-closing foreign-namespace `script` and `style` use ordinary element nodes. Complete foreign
|
|
35
39
|
elements retain raw-text nodes and injection ranges, including CDATA delimiters. MathML `annotation-xml` with an `encoding` value of `text/html` or `application/xhtml+xml`
|
|
@@ -42,7 +46,8 @@ before following text, entities, complete comments, and processing instructions,
|
|
|
42
46
|
Scanner serialization stores the open-tag stack from its innermost tag, compressing runs of identical tags, so active
|
|
43
47
|
void, script, and style elements retain their identities when deeply nested. When distinct tags exceed the fixed-size
|
|
44
48
|
buffer, serialization prioritizes inner tags and outer namespace boundaries, replacing ordinary outer tags with unknown
|
|
45
|
-
runs.
|
|
49
|
+
runs. Custom tag names are retained in full when they fit the remaining buffer. Names that exceed the buffer are
|
|
50
|
+
omitted along with older tags. Lost tag identities can still produce recovery errors when those tags close.
|
|
46
51
|
Malformed input after a void element can replace its enclosing element with an `ERROR` node during recovery.
|
|
47
52
|
|
|
48
53
|
Attribute values retain their complete `attribute_value` range and expose recognized named and numeric character
|
package/grammar.js
CHANGED
|
@@ -32,6 +32,8 @@ module.exports = grammar({
|
|
|
32
32
|
$._unquoted_attribute_entity,
|
|
33
33
|
$._attribute_ampersand,
|
|
34
34
|
$._unquoted_attribute_fragment,
|
|
35
|
+
$._discarded_start_tag,
|
|
36
|
+
$._missing_start_tag_end,
|
|
35
37
|
],
|
|
36
38
|
|
|
37
39
|
rules: {
|
|
@@ -52,6 +54,7 @@ module.exports = grammar({
|
|
|
52
54
|
$.doctype,
|
|
53
55
|
$.processing_instruction,
|
|
54
56
|
seq($._unfinished_processing_instruction, '>'),
|
|
57
|
+
seq('<', $._discarded_start_tag, alias($._missing_start_tag_end, '>')),
|
|
55
58
|
alias($._element_text, $.text),
|
|
56
59
|
$.comment,
|
|
57
60
|
$.entity,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-html",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"description": "HTML grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"oxlint-tsgolint": "7.0.2004",
|
|
56
56
|
"playwright": "1.64.0",
|
|
57
57
|
"semantic-release": "25.0.9",
|
|
58
|
-
"sort-package-json": "4.
|
|
58
|
+
"sort-package-json": "4.1.0",
|
|
59
59
|
"vitest": "5.0.3",
|
|
60
60
|
"wrangler": "4.149.0"
|
|
61
61
|
},
|
package/tree-sitter-html.wasm
CHANGED
|
Binary file
|