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
Pug: classes not extracted after a text line with an unbalanced ( #20545
A Pug text line containing an unbalanced opening bracket (here | (, which renders a literal "(") stops the
class shorthand on the next tag from being extracted, so those utilities silently get no CSS. Pug itself
renders the template correctly. A real-world case is wrapping a button in parentheses: | (, then v-btn.px-0.normal-case(...), then | ).
The cause appears to be the bracket tracking in crates/oxide/src/extractor/pre_processors/pug.rs: the BracketStack is kept across the whole file, so the ( in the text line is pushed and never matched.
While the stack is non-empty, . is no longer replaced with a space, so span.underline.font-bold stays a
single, invalid candidate. The tag's own attribute parens don't help: its ) pops only its own (.
The same happens inside Vue SFCs (<template lang="pug">), where only some of the classes are extracted.
A comment line behaves the same way: //- a bare "(" here before the tag reproduces it too.
Workaround: write the bracket as an HTML entity (| () or keep brackets balanced on the text line.
Possible fix: reset the bracket stack at line boundaries unless the line is inside an attribute list
(Pug attribute lists may span lines, so a plain per-line reset is not enough), or skip piped text (| ...)
and comment (//, //-) lines in the pre-processor.
Activity
Don't let unbalanced brackets in Pug text leak into the next line (#2…