withastro / compiler

The Astro compiler. Written in Go. Distributed as WASM.
Other
502 stars 59 forks source link

🐛 BUG: "Unterminated string literal" when breaking `class=""` into multiple lines #1047

Open gersomvg opened 1 month ago

gersomvg commented 1 month ago

What version of @astrojs/compiler are you using?

2.10.3

What package manager are you using?

pnpm

What operating system are you using?

mac

Describe the Bug

Using prettier-plugin-classnames will lead to newlines being inserted into class="". This is valid HTML as far as I know, but Astro won't allow it and throws a Unterminated string literal.

Earlier issue over at the astro repo: https://github.com/withastro/astro/issues/4029

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-yiuhkm?file=src%2Fpages%2Findex.astro