🐛 CSS parser does not recognize multiple semicolons after a declaration #3836
Labels
A-Formatter
Area: formatter
L-CSS
Language: CSS
S-Bug-confirmed
Status: report has been confirmed as a valid bug
Environment information
What happened?
Biome's CSS parser raises a parser error when a CSS declaration ends with multiple semicolons, e.g.
Sorry if it was reported already, but I couldn't find an issue for that.
Expected result
The CSS file parses correctly. The formatter could simply remove multiple semicolons. This is what prettier does
More info
For some context: One of my colleagues use IntelliJ to author a CSS file, and it did not show any errors. During the pre-commit hook, when biome was called to format the CSS file, it reported a syntax error in the CSS file. Took him some time to find the issue. It turned out the issue was that a declaration in the CSS file had 2 semicolons at the (
;
)I took a look at the CSS specification. If I understand it correctly, CSS syntax 3, 5.4.5, Consume a list of declarations allows for multiple semicolons:
Various other tools such as IntelliJ, VSCode or https://jigsaw.w3.org/css-validator/validator also accept multiple semicolons. Biome however produces a parser error (tested with 1.8.3)
According to this comment here in declaration_or_rule_list_block.rs, the parser only seems to consider a single semicolon for now.
Code of Conduct
The text was updated successfully, but these errors were encountered: