Skip to content

Commit e9e4381

Browse files
committed
If units are not specified, we need to handle that too in the regex.
1 parent b512ef4 commit e9e4381

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ CVS/
1111
build/classes
1212
build/jar
1313
build/build_tmp
14+
build/yuicompressor*.jar
1415
.project
1516
.classpath

build/yuicompressor-2.4.9.jar

-771 KB
Binary file not shown.

src/com/yahoo/platform/yui/compressor/CssCompressor.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,10 +496,11 @@ public void compress(Writer out, int linebreakpos)
496496
while (m.find()) {
497497
String s = m.group();
498498

499-
s = s.replaceAll("(?<=[%|px|em|rem|vw]+)\\+", " + ");
500-
s = s.replaceAll("(?<=[%|px|em|rem|vw]+)\\-", " - ");
501-
s = s.replaceAll("(?<=[%|px|em|rem|vw]+)\\*", " * ");
502-
s = s.replaceAll("(?<=[%|px|em|rem|vw]+)\\/", " / ");
499+
s = s.replaceAll("(?<=[%|px|em|rem|vw|\\d]+)\\+", " + ");
500+
s = s.replaceAll("(?<=[%|px|em|rem|vw|\\d]+)\\-", " - ");
501+
s = s.replaceAll("(?<=[%|px|em|rem|vw|\\d]+)\\*", " * ");
502+
s = s.replaceAll("(?<=[%|px|em|rem|vw|\\d]+)\\/", " / ");
503+
503504
m.appendReplacement(sb, s);
504505
}
505506
m.appendTail(sb);

0 commit comments

Comments
 (0)