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

@charset isn't being stripped from CSS; causes AMP validation error #1068

Closed
douglyuckling opened this issue Apr 11, 2018 · 1 comment
Closed
Labels

Comments

@douglyuckling
Copy link
Contributor

My theme's style.css begins with @charset "UTF-8";, but that apparently isn't allowed in AMP. It's not being stripped out when I use my theme in "paired mode", which causes an AMP validation error for me.

In case it matters, the version of this plugin I'm using is commit 5ba9f5b from the 0.7 branch.

@westonruter
Copy link
Member

@douglyuckling thanks. This is something that is being addressed with having an actual CSS parser in #1048 now merged into develop (1.0-alpha). You can see from the unit tests that @charset is specifically being accounted for and getting stripped:

https://github.com/Automattic/amp-wp/blob/40d1945778c9917ed258e74595d504ad31719d39/tests/test-amp-style-sanitizer.php#L133-L140

Please try the develop branch and you should see it gets removed successfully.

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

No branches or pull requests

3 participants