Skip to content

Commit 81e6306

Browse files
authored
fix(html/parser): fence in html files (#9537)
1 parent b630d93 commit 81e6306

File tree

4 files changed

+513
-3
lines changed

4 files changed

+513
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@biomejs/biome": patch
3+
---
4+
5+
Fixed [#9238](https://github.com/biomejs/biome/issues/9238): The HTML parser no longer incorrectly reports `---` inside element content (e.g. `<td>---</td>`) as an "Unexpected value or character" error.

crates/biome_html_parser/src/syntax/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ pub(crate) fn parse_root(p: &mut HtmlParser) {
9898
// Whether or not frontmatter was present, once we're past the frontmatter
9999
// position `---` can no longer start a fence. This prevents `---` in HTML
100100
// content from being incorrectly lexed as a FENCE token.
101-
if p.options().frontmatter {
102-
p.set_after_frontmatter(true);
103-
}
101+
p.set_after_frontmatter(true);
104102

105103
parse_doc_type(p).ok();
106104
ElementList.parse_list(p);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<table>
2+
<thead>
3+
<tr><th>Name</th><th>Description</th></tr>
4+
</thead>
5+
<tbody>
6+
<tr>
7+
<td>---</td>
8+
<td>create a duration of 0ms</td>
9+
</tr>
10+
</tbody>
11+
</table>
12+
<div>---</div>
13+
<p>-- text --</p>
14+
<span>--- some text ---</span>

0 commit comments

Comments
 (0)