Environment information
Details
CLI:
Version: 2.4.14
Color support: true
Platform:
CPU Architecture: aarch64
OS: macos
Environment:
JS_RUNTIME_VERSION: v25.9.0
JS_RUNTIME_NAME: node
What happened?
Since 2.4.14, the HTML parser rejects any text node that starts with the word of. The same input parses cleanly on 2.4.13.
Minimal repro (.html or .astro):
Output:
test.html:1:4 parse
× Unexpected value or character.
> 1 │ <p>of</p>
│ ^^
i Expected one of:
- element
- text
A few notes from poking at it:
- Only the literal word
of triggers it. for, in, from, as, typeof, etc. are all fine.
- Only matters when
of is the first token of a text node. <p>The of</p> parses fine; <p>of Y</p> does not.
- Common case in real content is after a closing inline tag:
<p>The <strong>X</strong> of Y.</p> fails because the space after </strong> starts a new text node beginning with of.
- Affects both the HTML and Astro parsers (shared lexer).
Bisected to 2.4.14:
| Version |
<p>of</p> |
| 2.4.10 |
OK |
| 2.4.11 |
OK |
| 2.4.12 |
OK |
| 2.4.13 |
OK |
| 2.4.14 |
parse error |
The only HTML-parser change in 2.4.14 is #10178 (fix(parse/html): relex keywords as text in text contexts), which looks like the likely source. That change taught the parser to relex html/doctype as text after void elements, and seems to have left of mis-classified as a non-text keyword in this position.
Steps to reproduce:
mkdir biome-of-bug && cd biome-of-bug
npm init -y && npm i -D @biomejs/biome@2.4.14
printf '<p>of</p>\n' > test.html
npx biome check test.html --files-ignore-unknown=false
Expected result
The parser should accept <p>of</p> as plain text content, identical to 2.4.13 behaviour.
Code of Conduct
Environment information
Details
What happened?
Since 2.4.14, the HTML parser rejects any text node that starts with the word
of. The same input parses cleanly on 2.4.13.Minimal repro (
.htmlor.astro):Output:
A few notes from poking at it:
oftriggers it.for,in,from,as,typeof, etc. are all fine.ofis the first token of a text node.<p>The of</p>parses fine;<p>of Y</p>does not.<p>The <strong>X</strong> of Y.</p>fails because the space after</strong>starts a new text node beginning withof.Bisected to 2.4.14:
<p>of</p>The only HTML-parser change in 2.4.14 is #10178 (
fix(parse/html): relex keywords as text in text contexts), which looks like the likely source. That change taught the parser to relexhtml/doctypeas text after void elements, and seems to have leftofmis-classified as a non-text keyword in this position.Steps to reproduce:
mkdir biome-of-bug && cd biome-of-bugnpm init -y && npm i -D @biomejs/biome@2.4.14printf '<p>of</p>\n' > test.htmlnpx biome check test.html --files-ignore-unknown=falseExpected result
The parser should accept
<p>of</p>as plain text content, identical to 2.4.13 behaviour.Code of Conduct