Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-svelte-keywords-text-content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@biomejs/biome": patch
---

Fixed parsing of Svelte directive keywords (`use`, `style`) when used as plain text content in HTML/Svelte files. Previously, `<p>use JavaScript</p>` or `<p>style it</p>` would incorrectly produce a bogus element instead of proper text content.
9 changes: 2 additions & 7 deletions crates/biome_html_parser/src/syntax/svelte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,13 +1241,8 @@ const SVELTE_KEYWORDS: TokenSet<HtmlSyntaxKind> = token_set!(
T![catch],
T![then],
T![snippet],
T![class],
T![in],
T![out],
T![transition],
T![animate],
T![bind]
);
)
.union(SVELTE_DIRECTIVE_KEYWORDS);

const SVELTE_DIRECTIVE_KEYWORDS: TokenSet<HtmlSyntaxKind> = token_set!(
T![bind],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<span>use </span>
<span>style </span>
<span>bind </span>
<span>transition </span>
<span>in </span>
<span>out </span>
<span>class </span>
<span>animate </span>
<p>
use JavaScript on the
</p>
Loading