Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #208 from christanto/master

Fix #205: IllegalArgumentException when dollar sign is followed by @charset
commit c41a4b504a996b9c2a49b497e2f61ba7998b0408 2 parents b7d4e6c + e8fbfd0
@tml tml authored
View
3  src/com/yahoo/platform/yui/compressor/CssCompressor.java
@@ -261,7 +261,8 @@ public void compress(Writer out, int linebreakpos)
p = Pattern.compile("(?i)^(.*)(@charset)( \"[^\"]*\";)");
m = p.matcher(css);
while (m.find()) {
- m.appendReplacement(sb, m.group(2).toLowerCase() + m.group(3) + m.group(1));
+ String s = m.group(1).replaceAll("\\\\", "\\\\\\\\").replaceAll("\\$", "\\\\\\$");
+ m.appendReplacement(sb, m.group(2).toLowerCase() + m.group(3) + s);
}
m.appendTail(sb);
css = sb.toString();
View
2  tests/issue205.css
@@ -0,0 +1,2 @@
+a[id$=_foo] { abc : abc;};
+@charset "utf-8";
View
1  tests/issue205.css.min
@@ -0,0 +1 @@
+@charset "utf-8";a[id$=_foo]{abc:abc};
Please sign in to comment.
Something went wrong with that request. Please try again.