@willbooster/tree-sitter-html 3.0.0 → 3.1.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 +1 -1
- package/grammar.js +3 -1
- package/package.json +1 -1
- package/src/node-types.json +15 -0
- package/tree-sitter-html.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ number, so it loads only with the WillBooster runtime, version 2.x
|
|
|
20
20
|
it. Input that contains NUL characters can parse to a different tree than with upstream's 0.23.2 parser, because the
|
|
21
21
|
lexers that generator emits treat a NUL character as an ordinary character. This grammar also accepts literal `>`
|
|
22
22
|
characters and bare `&` in text nodes, which upstream 0.23.2 rejects. A bare `&` becomes its own `text` node beside
|
|
23
|
-
surrounding text, while character references remain `entity` nodes. Text nodes include leading, trailing, and whitespace-only content, including whitespace between markup and character references.
|
|
23
|
+
surrounding text, while character references remain `entity` nodes. Text nodes include leading, trailing, and whitespace-only content, including whitespace between markup and character references. A DOCTYPE declaration exposes its uninterpreted body as a `doctype_value` child, including legacy PUBLIC or SYSTEM identifiers. The grammar's scanner requires an HTML tag-name boundary after
|
|
24
24
|
`</script` and `</style`, so longer names and overlapping prefixes remain raw text. Closing-name comparisons
|
|
25
25
|
fold only ASCII letters, and embedded NUL characters remain part of raw-text content. Script content follows
|
|
26
26
|
HTML escaped and double-escaped states, so closing-tag text inside a double escape remains raw text. A script that reaches
|
package/grammar.js
CHANGED
|
@@ -37,12 +37,14 @@ module.exports = grammar({
|
|
|
37
37
|
doctype: $ => seq(
|
|
38
38
|
'<!',
|
|
39
39
|
alias($._doctype, 'doctype'),
|
|
40
|
-
|
|
40
|
+
$.doctype_value,
|
|
41
41
|
'>',
|
|
42
42
|
),
|
|
43
43
|
|
|
44
44
|
_doctype: _ => /[Dd][Oo][Cc][Tt][Yy][Pp][Ee]/,
|
|
45
45
|
|
|
46
|
+
doctype_value: _ => repeat1(/[^>]+/),
|
|
47
|
+
|
|
46
48
|
_node: $ => choice(
|
|
47
49
|
$.doctype,
|
|
48
50
|
$.comment,
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
|
@@ -40,6 +40,21 @@
|
|
|
40
40
|
{
|
|
41
41
|
"type": "doctype",
|
|
42
42
|
"named": true,
|
|
43
|
+
"fields": {},
|
|
44
|
+
"children": {
|
|
45
|
+
"multiple": false,
|
|
46
|
+
"required": true,
|
|
47
|
+
"types": [
|
|
48
|
+
{
|
|
49
|
+
"type": "doctype_value",
|
|
50
|
+
"named": true
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "doctype_value",
|
|
57
|
+
"named": true,
|
|
43
58
|
"fields": {}
|
|
44
59
|
},
|
|
45
60
|
{
|
package/tree-sitter-html.wasm
CHANGED
|
Binary file
|