@willbooster/tree-sitter-html 1.0.3 → 1.0.5

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
@@ -1,9 +1,11 @@
1
1
  # @willbooster/tree-sitter-html
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@willbooster/tree-sitter-html.svg)](https://www.npmjs.com/package/@willbooster/tree-sitter-html)
4
+ [![license](https://img.shields.io/npm/l/@willbooster/tree-sitter-html.svg)](https://www.npmjs.com/package/@willbooster/tree-sitter-html)
3
5
  [![Test](https://github.com/WillBooster/tree-sitter-html/actions/workflows/test.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-html/actions/workflows/test.yml)
4
6
  [![Test rust](https://github.com/WillBooster/tree-sitter-html/actions/workflows/test-rust.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-html/actions/workflows/test-rust.yml)
5
7
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
6
- [![wbfy](https://img.shields.io/badge/wbfy-20.36.11-1e90ff.svg)](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
8
+ [![wbfy](https://img.shields.io/badge/wbfy-20.41.8-1e90ff.svg)](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
7
9
  [![crates.io](https://img.shields.io/crates/v/willbooster-tree-sitter-html.svg)](https://crates.io/crates/willbooster-tree-sitter-html)
8
10
 
9
11
  HTML grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
@@ -17,12 +19,15 @@ number, so it loads only with the WillBooster runtime, version 2.0.0 or later
17
19
  [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter)); upstream's runtime rejects
18
20
  it. Input that contains NUL characters can parse to a different tree than with upstream's 0.23.2 parser, because the
19
21
  lexers that generator emits treat a NUL character as an ordinary character. This grammar also accepts literal `>`
20
- characters in text nodes, which upstream 0.23.2 rejects. Its scanner requires an HTML tag-name boundary after
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. Its scanner requires an HTML tag-name boundary after
21
24
  `</script` and `</style`, so longer names and overlapping prefixes remain raw text. Closing-name comparisons
22
25
  fold only ASCII letters, and embedded NUL characters remain part of raw-text content. Void elements close
23
26
  before following text, entities, and complete comments, which become siblings instead of children.
24
- This depends on the open-tag stack fitting in the scanner serialization buffer; deep nesting, especially with
25
- custom tag names, can exhaust it and retain the following content under the void element.
27
+ Scanner serialization stores the open-tag stack from its innermost tag, compressing runs of identical tags, so active
28
+ void, script, and style elements retain their identities when deeply nested. When deep nesting of distinct tags
29
+ exceeds its fixed-size buffer, the outermost tag identities are lost, which can produce recovery errors when those
30
+ tags close. Custom tag names longer than 255 bytes are truncated in serialized state.
26
31
  Malformed input after a void element can replace its enclosing element with an `ERROR` node during recovery.
27
32
 
28
33
  ## Usage
package/grammar.js CHANGED
@@ -134,6 +134,6 @@ module.exports = grammar({
134
134
  seq('"', optional(alias(/[^"]+/, $.attribute_value)), '"'),
135
135
  ),
136
136
 
137
- text: _ => /[^<&\s]([^<&]*[^<&\s])?/,
137
+ text: _ => /[^<&\s]([^<&]*[^<&\s])?|&/,
138
138
  },
139
139
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-html",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
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": "2.0.24",
50
+ "@willbooster/web-tree-sitter": "2.0.27",
51
51
  "conventional-changelog-conventionalcommits": "10.4.1",
52
52
  "lefthook": "2.2.1",
53
53
  "oxfmt": "0.72.0",
@@ -56,7 +56,6 @@
56
56
  "playwright": "1.64.0",
57
57
  "semantic-release": "25.0.9",
58
58
  "sort-package-json": "4.0.0",
59
- "typescript": "7.0.2",
60
59
  "vitest": "5.0.3",
61
60
  "wrangler": "4.149.0"
62
61
  },
Binary file
package/tree-sitter.json CHANGED
@@ -18,7 +18,7 @@
18
18
  }
19
19
  ],
20
20
  "metadata": {
21
- "version": "1.0.3",
21
+ "version": "1.0.5",
22
22
  "license": "MIT",
23
23
  "description": "HTML grammar for tree-sitter",
24
24
  "authors": [