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

Support @charset in the CSS #296

Closed
visioncan opened this issue Jan 28, 2016 · 3 comments
Closed

Support @charset in the CSS #296

visioncan opened this issue Jan 28, 2016 · 3 comments
Milestone

Comments

@visioncan
Copy link

My css file with @charset "UTF-8" like:

@charset "UTF-8";
body {...} 

will output wraning:

Warning: DOMXPath::query(): Invalid expression in /Users/../vendor/pelago/emogrifier/Classes/Emogrifier.php on line 353
@oliverklee oliverklee changed the title css file with charset warning Support @charset in the CSS Jan 28, 2016
@oliverklee
Copy link
Contributor

https://developer.mozilla.org/en/docs/Web/CSS/@charset

Currently, Emogrifier does not support charset in the CSS yet. If you are using only ASCII characters in your CSS, you can safely remove the charset.

@oliverklee oliverklee added this to the 4.0.0 milestone Jan 7, 2018
JakeQZ added a commit to JakeQZ/emogrifier that referenced this issue Feb 8, 2018
Filter out `@charset` at-rules from the CSS before processing, to avoid an error
when presented with CSS containing this at-rule.

Obviously this does not mean `@charset` is supported - its value is still
ignored - but does address the immediate error in MyIntervals#296.

Added PHPUnit test like that for `@import`, and also test that such CSS content
does not prevent Emogrifier working correctly on the remainder of the CSS.
oliverklee pushed a commit that referenced this issue Feb 8, 2018
Filter out `@charset` at-rules from the CSS before processing, to avoid an error
when presented with CSS containing this at-rule.

Obviously this does not mean `@charset` is supported - its value is still
ignored - but does address the immediate error in #296.

Added PHPUnit test like that for `@import`, and also test that such CSS content
does not prevent Emogrifier working correctly on the remainder of the CSS.
@JakeQZ
Copy link
Contributor

JakeQZ commented Sep 29, 2019

We added support for dropping @charset rules without impacting CSS parsing in 2.0.

I don't think we'll ever support alternative charsets to UTF-8, which is the norm these days, unless that norm miraculously changes.

Can we close this as either 'fixed' or 'wontfix'?

@oliverklee oliverklee modified the milestones: 4.0.0, 3.0.0 Sep 29, 2019
@oliverklee
Copy link
Contributor

Yes, let's close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants