@willbooster/tree-sitter-html 5.0.0 → 6.0.1

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
@@ -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. Script content follows
32
+ fold only ASCII letters, and embedded NUL characters remain part of raw-text content. In the HTML namespace, a trailing
33
+ slash on a `script` or `style` opening tag remains part of its `start_tag`; it does not close the element, so subsequent
34
+ content remains raw text until the matching end tag. Self-closing foreign-namespace `script` and `style` use ordinary element nodes. Complete foreign
35
+ 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`
36
+ uses HTML parsing for its children. Encoding comparisons ignore ASCII case and decode character references. Script content follows
33
37
  HTML escaped and double-escaped states, so closing-tag text inside a double escape remains raw text. A script that reaches
34
38
  EOF while scanning raw content closes implicitly without an error: its `script_element` has no `end_tag` child, and its
35
39
  remaining content stays available for JavaScript injection. Incomplete closing tags such as `</script` still report
@@ -99,7 +103,7 @@ fuzzed with:
99
103
  ```toml
100
104
  [dependencies]
101
105
  tree-sitter = { package = "willbooster-tree-sitter", version = "7.0.5" }
102
- tree-sitter-html = { package = "willbooster-tree-sitter-html", version = "5" }
106
+ tree-sitter-html = { package = "willbooster-tree-sitter-html", version = "6" }
103
107
  ```
104
108
 
105
109
  ```rust
package/grammar.js CHANGED
@@ -95,14 +95,14 @@ module.exports = grammar({
95
95
  '<',
96
96
  alias($._script_start_tag_name, $.tag_name),
97
97
  repeat($.attribute),
98
- '>',
98
+ choice('>', '/>'),
99
99
  ),
100
100
 
101
101
  style_start_tag: $ => seq(
102
102
  '<',
103
103
  alias($._style_start_tag_name, $.tag_name),
104
104
  repeat($.attribute),
105
- '>',
105
+ choice('>', '/>'),
106
106
  ),
107
107
 
108
108
  self_closing_tag: $ => seq(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-html",
3
- "version": "5.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "HTML grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
package/tree-sitter.json CHANGED
@@ -20,7 +20,7 @@
20
20
  }
21
21
  ],
22
22
  "metadata": {
23
- "version": "5.0.0",
23
+ "version": "6.0.1",
24
24
  "license": "MIT",
25
25
  "description": "HTML grammar for tree-sitter",
26
26
  "authors": [