lupuswwww / cssmin

Automatically exported from code.google.com/p/cssmin
0 stars 0 forks source link

Incorrect removal of all spaces following ']' character #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a CSS file with a rule like the following:

   td[scope=row] p { ... }

2. Run css thru cssmin

What is the expected output? What do you see instead?
Expected:
td[scope=row] p{ ... }

Actual:
td[scope=row]p{ ... }

The actual result breaks the CSS rule ( tested in FF 3 )

What version of the product are you using? On what operating system?
1.0.1.b3 (2008-10-02)

Please provide any additional information below.

Here's a diff of the fix ( the revision numbers correspond to my local SVN
repo ):

Index: cssmin.php
===================================================================
--- cssmin.php  (revision 42961)
+++ cssmin.php  (working copy)
@@ -59,7 +59,7 @@ (root):cssmin(class):minify(function)
        // Replace multiple to single space
        $css = preg_replace("/\s\s+/", " ", $css);
        // Remove unneeded spaces
-       $css = preg_replace("/\s*({|}|\[|\]|=|~|\+|>|\||;|:|,)\s*/", "$1", $css);
+       $css = preg_replace("/\s*({|}|\[|=|~|\+|>|\||;|:|,)\s*/", "$1", $css);
        if (in_array("remove-last-semicolon", $options))
            {
            // Removes the last semicolon of every style definition

Original issue reported on code.google.com by jmer...@gmail.com on 6 Jan 2009 at 8:09

GoogleCodeExporter commented 8 years ago

Original comment by joe.scylla on 15 Apr 2009 at 12:12

GoogleCodeExporter commented 8 years ago
Fixed in v2.0.0.b1

Original comment by joe.scylla on 6 Aug 2010 at 1:08