My asset pipeline changed a bit and the generated CSS was updated to start with this:
@charset "UTF-8";
This caused Premailex to crash when inlining styles, like you can see here:
** (FunctionClauseError) no function clause matching in Floki.Selector.Parser.do_parse/2
I was able to work around it by adding a Webpack plugin to strip the @charset line from the CSS, but I figured this might happen to others so here’s a draft fix.
It seems hackish, though maybe unavoidable considering #30? I’m also unsure why @keyframes and the like wouldn’t cause similar problems.
Yeah, other at-rules will fail as well. I'm gonna merge this, and release fix, but I think I need to build a proper CSS parser instead. Though it can be forced to work in most cases, the regex is hacky.
My asset pipeline changed a bit and the generated CSS was updated to start with this:
This caused Premailex to crash when inlining styles, like you can see here:
I was able to work around it by adding a Webpack plugin to strip the
@charset
line from the CSS, but I figured this might happen to others so here’s a draft fix.It seems hackish, though maybe unavoidable considering #30? I’m also unsure why
@keyframes
and the like wouldn’t cause similar problems.