Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esbuild breaks font:16px"Menlo" when minifying #3452

Closed
unilynx opened this issue Oct 16, 2023 · 0 comments
Closed

esbuild breaks font:16px"Menlo" when minifying #3452

unilynx opened this issue Oct 16, 2023 · 0 comments

Comments

@unilynx
Copy link

unilynx commented Oct 16, 2023

Given the following CSS

.testfontrewrite {
  font: 9pt/16px"Menlo";
}

esbuild 0.19.4 with minify (esbuild --minify test.css) will output

.testfontrewrite{font:9pt/16pxMenlo}

Stripping the quotes around Menlo and breaking the font declaration

(this started after I updated csstree from 1.x to 2.x which removed the whitespace)

I'm no expert on CSS parsing... Reading https://www.w3.org/TR/css-syntax-3/#consume-token I think a quote should trigger a separate string token, even without spaces. Browers tolerate it too, so I think csstree 2 is correct in doing this, and esbuild shouldn't strip the quotes (or re-add the space)

If I disable minifying everything works fine. If I'm misinterpreting the CSS parse rules I'll be happy to report the issue to csstree instead :-)

@evanw evanw closed this as completed in a579bd8 Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant