-
Notifications
You must be signed in to change notification settings - Fork 154
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
[BUGFIX] Allow @charset without error #507
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look generally very good. The test name needs more love, though.
tests/Unit/EmogrifierTest.php
Outdated
* | ||
* @dataProvider unneededCssThingsDataProvider | ||
*/ | ||
public function emogrifyUnaffectedByUnneededCssThings($css) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let's rename the test to be more specific. What does "unaffected" mean?
(And please add a verb so that the test name is a (possible pidgin) sentence.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have renamed the method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful!
Merged. Thanks for the bug fix, @JakeQZ! ❤️ |
Filter out
@charset
at-rules from the CSS before processing, to avoid an errorwhen presented with CSS containing this at-rule.
Obviously this does not mean
@charset
is supported - its value is stillignored - but does address the immediate error in #296.
Added PHPUnit test like that for
@import
, and also test that such CSS contentdoes not prevent Emogrifier working correctly on the remainder of the CSS.