diff --git a/min/lib/Minify/HTML.php b/min/lib/Minify/HTML.php index 674764d..615ef6c 100644 --- a/min/lib/Minify/HTML.php +++ b/min/lib/Minify/HTML.php @@ -99,6 +99,9 @@ class Minify_HTML { ,array('Minify_HTML', '_outsideTagCB') ,$html); + // use newlines before 1st attribute in open tags (to limit line lengths) + $html = preg_replace('/(<[a-z\\-]+)\\s+([^>]+>)/i', "$1\n$2", $html); + // fill placeholders $html = str_replace( array_keys(self::$_placeholders) @@ -107,9 +110,6 @@ class Minify_HTML { ); self::$_placeholders = array(); - // use newlines before 1st attribute in open tags (to limit line lengths) - $html = preg_replace('/(<[a-z\\-]+)\\s+([^>]+>)/i', "$1\n$2", $html); - self::$_cssMinifier = self::$_jsMinifier = null; return $html; } diff --git a/min_unit_tests/_test_files/html/before.min.html b/min_unit_tests/_test_files/html/before.min.html index d8862c2..369333a 100644 --- a/min_unit_tests/_test_files/html/before.min.html +++ b/min_unit_tests/_test_files/html/before.min.html @@ -4,18 +4,12 @@ http-equiv="content-type" content="text/html; charset=iso-8859-1" />css Zen Garden: The Beauty in CSS DesignA demonstration of what can be accomplished visually through CSS-based design. Select any style sheet from the list to load it into this page.

Download the sample html file and css file

\ No newline at end of file diff --git a/min_unit_tests/_test_files/html/before2.min.html b/min_unit_tests/_test_files/html/before2.min.html index 69168aa..ce777ae 100644 --- a/min_unit_tests/_test_files/html/before2.min.html +++ b/min_unit_tests/_test_files/html/before2.min.html @@ -4,18 +4,12 @@ http-equiv="content-type" content="text/html; charset=iso-8859-1">css Zen Garden: The Beauty in CSS DesignA demonstration of what can be accomplished visually through CSS-based design. Select any style sheet from the list to load it into this page.

Download the sample html file and css file

\ No newline at end of file