You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which ought to be three selectors, .foo, .btn, and .bar. However, css parses it as a single .foo selector with a very mangled background-image declaration:
, where it's trying to use /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/ to match url("data:image/svg+xml;charset=utf-8,%3Csvg%3E%3Ccircle r='3' fill='rgba(0,0,0,0)'/%3E%3C/svg%3E")}.btn{color:#FF0}.bar{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%3E%3Cpath fill='%233ad599'/%3E%3C/svg%3E")} but I'm struggling to figure out suitable regexp magic to avoid the over-eager matching.
The text was updated successfully, but these errors were encountered:
jdelStrother
changed the title
Declaration parsing fails with this mess of quotes & braces
Declaration parsing fails with this mess of quotes, brackets & braces
Sep 21, 2021
I'm not sure if this is in scope for this project, but I was trying to parse this minified css:
which ought to be three selectors,
.foo
,.btn
, and.bar
. However,css
parses it as a single.foo
selector with a very mangled background-image declaration:I traced the problem as far as the declaration regexp here:
css/lib/parse/index.js
Line 227 in 434aa17
/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/
to matchurl("data:image/svg+xml;charset=utf-8,%3Csvg%3E%3Ccircle r='3' fill='rgba(0,0,0,0)'/%3E%3C/svg%3E")}.btn{color:#FF0}.bar{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%3E%3Cpath fill='%233ad599'/%3E%3C/svg%3E")}
but I'm struggling to figure out suitable regexp magic to avoid the over-eager matching.The text was updated successfully, but these errors were encountered: