Hack to work around CSS minify bug
authorNigel Metheringham <nigel.metheringham@dev.intechnology.co.uk>
Mon, 19 Jul 2010 20:32:31 +0000 (21:32 +0100)
committerNigel Metheringham <nigel.metheringham@dev.intechnology.co.uk>
Mon, 19 Jul 2010 20:32:31 +0000 (21:32 +0100)
https://rt.cpan.org/Public/Bug/Display.html?id=59549

script/gen.pl

index d086fd38551e9f6e03d2c9a131e3777e655d2413..a0a15b03bbab185202ff4ec897863c4bce8ed5c8 100755 (executable)
@@ -62,7 +62,9 @@ sub do_web {
                     if ( $path =~ /(.+)\.css$/ ) {
                         print "CSS to  : docroot:/$path\n";
                         my $content = read_file("$opt{tmpl}/web/$path");
-                        write_file( "$opt{docroot}/$path", $opt{minify} ? CSS::Minifier::XS::minify($content) : $content );
+                        my $output = $opt{minify} ? CSS::Minifier::XS::minify($content) : $content;
+                        $output =~ s/and\(/and (/g;    # hack round minify bug
+                        write_file( "$opt{docroot}/$path", $output );
                     }
                     elsif ( $path =~ /(.+)\.js$/ ) {
                         print "JS to  : docroot:/$path\n";