-
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
Noisy error on malformed CSS #237
Comments
What CSS is causing this problem? |
I got the same problem. Maybe this helps to track down the problem?
|
Okay, so it looks like Emogrifier currently does not support negative attribute selectors (i.e., this is missing feature). Anyone willing to implement this? |
That just sounds like XPath and CSS selectors do not share the same syntax for that kind of lookup. I suspect in my case it was simply malformed CSS rather than a missing feature - e.g. if someone puts HTML tags in the CSS, which I've seen. From the source of my CSS, I strongly suspect it's just random junk rather than anything as sophisticated as this missing selector, so the rename may not be quite appropriate. |
Okay, I've reverted the changes to this ticket. Thanks for the input! (We already have #227 for the missing feature anyway.) |
I've managed to track down some CSS that's causing this error - it's an empty media query. In the Emogrifier class, the I've set up the content and the regex it uses here, and you can see it going wrong. Following on from that, when it gets to
Which is invalid, but still gets translated into the invalid XPath:
After which I get the error:
So it would be good if Emogrifier could cope with a missing media query body. Meanwhile, I'll try to track down why my media queries are empty - I supect an old version of CSSTidy may be at fault. |
Much like #179, I've been getting this from something malformed:
That line is:
So it may well be fixed by a fix for #179 by eliminating the bogus selector, but it shouldn't throw a noisy error like this anyway. Better to just ignore the content. When I've tracked down the content responsible for this error, I'll add it in here so we can build a test for it.
The text was updated successfully, but these errors were encountered: