Describe the bug
In a .svelte component <style> block, a CSS block comment containing an apostrophe (') can break Svelte’s CSS parsing and produce:
Unexpected end of input
The error is reported at the end of the style block (</style>), even though CSS braces/parens are balanced.
This is not a general comment issue: single-line and multi-line CSS comments parse fine unless they include this apostrophe case.
Expected behavior
Apostrophes inside CSS block comments should be treated as plain comment text and never affect parsing.
Actual behavior
Svelte reports:
Unexpected end of input
at the end of the <style> block.
Reproduction
Minimal reproduction
<style>
.foo {
left: min(
calc(1px),
/* across rows (so the marker ends at row 1's right edge). Disabled */
calc(2px)
);
}
</style>
If I change 1's to 1s (remove apostrophe), parsing succeeds.
System Info
- Svelte: `5.53.12`
- `svelte-check`: `4.4.5`
- `@sveltejs/kit`: `2.55.0`
- Node: `v22.17.1`
- npm: `11.6.2`
- OS: macOS (Darwin `25.4.0`)
Additional context
- Both single-line and multi-line CSS comments work in this file.
- The failure is tied to the apostrophe character in comment content (e.g.
1's).
- Error location points to style EOF, not the comment line.
Severity
annoyance
Describe the bug
In a
.sveltecomponent<style>block, a CSS block comment containing an apostrophe (') can break Svelte’s CSS parsing and produce:Unexpected end of inputThe error is reported at the end of the style block (
</style>), even though CSS braces/parens are balanced.This is not a general comment issue: single-line and multi-line CSS comments parse fine unless they include this apostrophe case.
Expected behavior
Apostrophes inside CSS block comments should be treated as plain comment text and never affect parsing.
Actual behavior
Svelte reports:
Unexpected end of inputat the end of the
<style>block.Reproduction
Minimal reproduction
If I change
1'sto1s(remove apostrophe), parsing succeeds.System Info
Additional context
1's).Severity
annoyance