Some comments prevent mangling CSS values
Closed this issue · 0 comments
ericcornelissen commented
Bug report
packages/core v0.1.23
Description
The built-in CSS language plugin will not mangle CSS values if there is a comment with either }
or ;
inside the CSS ruleset before the value to be mangled.
Reproduce
Bug 1
-
Have the following CSS:
.foobar { background-color: var(--color); color/*}*/: var(--color); }
-
Run WebMangler core v0.1.23 on this CSS with the CSS Language plugin enabled as well as the CSS variable mangler with the pattern
[a-z]+
. -
Observe the mangled CSS is:
.foobar { background-color: var(--a); color/*}*/: var(--color); }
Bug 2
-
Have the following CSS:
.foobar { background-color: var(--color); color: /*;*/ var(--color); }
-
Run WebMangler core v0.1.23 on this CSS with the CSS Language plugin enabled as well as the CSS variable mangler with the pattern
[a-z]+
. -
Observe the mangled CSS is:
.foobar { background-color: var(--a); color: /*;*/ var(--color); }