Commit c0d4b0c
authored
fix(parse/html): don't lex "use" as
<!--
IMPORTANT!!
If you generated this PR with the help of any AI assistance, please disclose it in the PR.
https://github.com/biomejs/biome/blob/main/CONTRIBUTING.md#ai-assistance-notice
-->
<!--
Thanks for submitting a Pull Request! We appreciate you spending the time to work on these changes.
Please provide enough information so that others can review your PR.
Once created, your PR will be automatically labeled according to changed files.
Learn more about contributing: https://github.com/biomejs/biome/blob/main/CONTRIBUTING.md
-->
## Summary
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve?-->
Previously, the HTML lexer emitted keyword tokens (e.g. `USE_KW`, `STYLE_KW`) when those words appear as plain text content between HTML tags. The parser has a guard (`is_at_svelte_keyword`) that re-lexes keyword tokens as `HtmlText` when they appear in a text-content position, but `T![use]` and `T![style]` were missing from that guard.
planned by sonnet 4.6 and tests generated by kimi k2.5
<!-- Link any relevant issues if necessary or include a transcript of any Discord discussion. -->
<!-- If you create a user-facing change, please write a changeset: https://github.com/biomejs/biome/blob/main/CONTRIBUTING.md#writing-a-changeset (your changeset is often a good starting point for this summary as well) -->
## Test Plan
<!-- What demonstrates that your implementation is correct? -->
added snapshot tests
## Docs
<!-- If you're submitting a new rule or action (or an option for them), the documentation is part of the code. Make sure rules and actions have example usages, and that all options are documented. -->
<!-- For other features, please submit a documentation PR to the `next` branch of our website: https://github.com/biomejs/website/. Link the PR here once it's ready. -->USE_KW when in html text content (#9151)1 parent 4317572 commit c0d4b0c
6 files changed
Lines changed: 825 additions & 7 deletions
File tree
- .changeset
- crates/biome_html_parser
- src/syntax
- tests/html_specs/ok
- svelte
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1241 | 1241 | | |
1242 | 1242 | | |
1243 | 1243 | | |
1244 | | - | |
1245 | | - | |
1246 | | - | |
1247 | | - | |
1248 | | - | |
1249 | | - | |
1250 | | - | |
| 1244 | + | |
| 1245 | + | |
1251 | 1246 | | |
1252 | 1247 | | |
1253 | 1248 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments