-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Warnings when parsing/inlining @rules in css #28
Comments
Related issue in premailer for Ruby: premailer/premailer#9 |
Yeah, it's because the regex for the CSSParser doesn't parse I'll see if I can fix this by stripping media queries from parsing. In the end though, regex is wrong and I really should build a proper tokenizer for it 😄 |
Maybe it's not a big deal, if it's just warnings and they rules are just skipped. But it would be nice if it's possible to suppress these warnings, as they are polluting the console and test results. I was fiddling with regex to strip all at-rules before parsing, but not fan of regex in this case either. |
I've been looking into building a CSS lexer and parser, and checked how Jason decodes JSON. This ruby library is interesting too: https://github.com/rgrove/crass/blob/master/lib/crass/tokenizer.rb And there's also this erlang project: https://github.com/acammack-r7/erlang-css The way Jason does it is probably the better option, but it'll require time to get working. Not sure if I'll have the time available to fix this anytime soon. Any help/suggestions would be welcome. I wouldn't suppress the warnings just in case there may be some unrelated errors that actually needs fixing. The warnings comes from Floki. |
I just added #29 to strip media queries with RegEx. If it works, I'll just push that out for now. |
Awesome, looks good! |
|
I get these warnings in the console:
When I'm inlining the CSS below:
When I remove the
@media
query the warnings are gone.Doesn't seem to be harmful though, styling seems to be inlined just fine.
The text was updated successfully, but these errors were encountered: