From 626075511ae1db1e539e8986e9b20fbfb1c64961 Mon Sep 17 00:00:00 2001
From: Steve Clay
Date: Sat, 27 Sep 2008 21:11:33 +0000
Subject: [PATCH] Minify/HTML.php : Fix of Issue 53
---
min/lib/Minify/HTML.php | 6 +++---
min_unit_tests/_test_files/html/before.min.html | 17 +++++------------
.../_test_files/html/before2.min.html | 17 +++++------------
3 files changed, 13 insertions(+), 27 deletions(-)
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