TAP5-2606 - Inline SVG image is broken in proudction mode, because whitespaces are... master
authorBalázs Palcsó <palcso.balazs@gmail.com>
Thu, 17 Jan 2019 17:58:46 +0000 (18:58 +0100)
committerBalázs Palcsó <palcso.balazs@gmail.com>
Thu, 17 Jan 2019 17:58:46 +0000 (18:58 +0100)
tapestry-webresources/src/main/java/com/yahoo/platform/yui/compressor/CssCompressor.java

index 673646b..4b085e0 100644 (file)
@@ -138,7 +138,8 @@ public class CssCompressor {
         css = sb.toString();
 
 
-        css = this.preserveToken(css, "url", "(?i)url\\(\\s*([\"']?)data\\:", true, preservedTokens);
+        css = this.preserveToken(css, "url", "(?i)url\\(\\s*([\"']?)data\\:\\s*image/svg\\+xml", false, preservedTokens);
+        css = this.preserveToken(css, "url", "(?i)url\\(\\s*([\"']?)data\\:\\s*(?!(image/svg\\+xml))", true, preservedTokens);
         css = this.preserveToken(css, "calc",  "(?i)calc\\(\\s*([\"']?)", false, preservedTokens);
         css = this.preserveToken(css, "progid:DXImageTransform.Microsoft.Matrix",  "(?i)progid:DXImageTransform.Microsoft.Matrix\\s*([\"']?)", false, preservedTokens);