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
{{ message }}
Repository navigation
Parse stylesheets with a tokenizer instead of a brace regex #536
CssParser::processCssString() splits the stylesheet with /(.*?)\{(.*?)\}/ (src/Css/CssParser.php:219), after url() values are protected with a %ZZ placeholder and @media blocks are unwrapped. A brace inside a string mangles its own rule. Whether the rule after it survives depends on whether the braces in the string happen to balance: q {quotes:"}" "{"} is mangled, and the next rule survives only because its two braces pair up.
Fix. Replace the regex with a tokenizer that handles strings containing {, } and ;, escapes, comments inside strings, and nested @media and @supports. It retires the %ZZ placeholder and the at-rule pass from #524. The selector tokenizer in #538 is separate and comes first.
Tests. Braces and semicolons inside strings and url(), escapes in selectors, comments inside strings, and nested at-rules.
Activity
jakejackson1 commentedon Sep 30, 2026
Fixed by #635.