mirror of
https://github.com/mrclay/minify.git
synced 2025-09-02 10:22:50 +02:00
Minify/HTML.php : Fix of Issue 53
This commit is contained in:
@@ -99,6 +99,9 @@ class Minify_HTML {
|
|||||||
,array('Minify_HTML', '_outsideTagCB')
|
,array('Minify_HTML', '_outsideTagCB')
|
||||||
,$html);
|
,$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
|
// fill placeholders
|
||||||
$html = str_replace(
|
$html = str_replace(
|
||||||
array_keys(self::$_placeholders)
|
array_keys(self::$_placeholders)
|
||||||
@@ -107,9 +110,6 @@ class Minify_HTML {
|
|||||||
);
|
);
|
||||||
self::$_placeholders = array();
|
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;
|
self::$_cssMinifier = self::$_jsMinifier = null;
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
@@ -4,18 +4,12 @@ http-equiv="content-type" content="text/html; charset=iso-8859-1" /><meta
|
|||||||
name="author" content="Dave Shea" /><meta
|
name="author" content="Dave Shea" /><meta
|
||||||
name="keywords" content="design, css, cascading, style, sheets, xhtml, graphic design, w3c, web standards, visual, display" /><meta
|
name="keywords" content="design, css, cascading, style, sheets, xhtml, graphic design, w3c, web standards, visual, display" /><meta
|
||||||
name="description" content="A demonstration of what can be accomplished visually through CSS-based design." /><meta
|
name="description" content="A demonstration of what can be accomplished visually through CSS-based design." /><meta
|
||||||
name="robots" content="all" /><title>css Zen Garden: The Beauty in CSS Design</title><script
|
name="robots" content="all" /><title>css Zen Garden: The Beauty in CSS Design</title><script type="text/javascript">var is={ie:navigator.appName=='Microsoft Internet Explorer',java:navigator.javaEnabled(),ns:navigator.appName=='Netscape',ua:navigator.userAgent.toLowerCase(),version:parseFloat(navigator.appVersion.substr(21))||parseFloat(navigator.appVersion),win:navigator.platform=='Win32'}
|
||||||
type="text/javascript">var is={ie:navigator.appName=='Microsoft Internet Explorer',java:navigator.javaEnabled(),ns:navigator.appName=='Netscape',ua:navigator.userAgent.toLowerCase(),version:parseFloat(navigator.appVersion.substr(21))||parseFloat(navigator.appVersion),win:navigator.platform=='Win32'}
|
|
||||||
is.mac=is.ua.indexOf('mac')>=0;if(is.ua.indexOf('opera')>=0){is.ie=is.ns=false;is.opera=true;}
|
is.mac=is.ua.indexOf('mac')>=0;if(is.ua.indexOf('opera')>=0){is.ie=is.ns=false;is.opera=true;}
|
||||||
if(is.ua.indexOf('gecko')>=0){is.ie=is.ns=false;is.gecko=true;}</script><script
|
if(is.ua.indexOf('gecko')>=0){is.ie=is.ns=false;is.gecko=true;}</script><script type="text/javascript">/*<![CDATA[*/var i=0;while(++i<10)
|
||||||
type="text/javascript">/*<![CDATA[*/var i=0;while(++i<10)
|
{}/*]]>*/</script><script type="text/javascript">i=1;</script><script type="text/javascript">/*<![CDATA[*/(i<1);/*]]>*/</script><!--[if IE 6]><style type="text/css">/*<![CDATA[*/
|
||||||
{}/*]]>*/</script><script
|
|
||||||
type="text/javascript">i=1;</script><script
|
|
||||||
type="text/javascript">/*<![CDATA[*/(i<1);/*]]>*/</script><!--[if IE 6]><style
|
|
||||||
type="text/css">/*<![CDATA[*/
|
|
||||||
/* copyright: you'll need CDATA for this < & */
|
/* copyright: you'll need CDATA for this < & */
|
||||||
body{background:white}/*]]>*/</style><![endif]--><style
|
body{background:white}/*]]>*/</style><![endif]--><style type="text/css" title="currentStyle" media="screen">@import "/001/001.css";/*\*/css
|
||||||
type="text/css" title="currentStyle" media="screen">@import "/001/001.css";/*\*/css
|
|
||||||
hack{}/**//*/*/css
|
hack{}/**//*/*/css
|
||||||
hack{}/**/css
|
hack{}/**/css
|
||||||
hack{display/**/:/**/none;display:none}</style><link
|
hack{display/**/:/**/none;display:none}</style><link
|
||||||
@@ -37,7 +31,6 @@ class="p1"><span>A demonstration of what can be accomplished visually through <a
|
|||||||
title="Cascading Style Sheets">CSS</acronym>-based design. Select any style sheet from the list to load it into this page.</span></p><p
|
title="Cascading Style Sheets">CSS</acronym>-based design. Select any style sheet from the list to load it into this page.</span></p><p
|
||||||
class="p2"><span>Download the sample <a
|
class="p2"><span>Download the sample <a
|
||||||
href="/zengarden-sample.html" title="This page's source HTML code, not to be modified.">html file</a> and <a
|
href="/zengarden-sample.html" title="This page's source HTML code, not to be modified.">html file</a> and <a
|
||||||
href="/zengarden-sample.css" title="This page's sample CSS, the file you may modify.">css file</a></span></p></div><textarea
|
href="/zengarden-sample.css" title="This page's sample CSS, the file you may modify.">css file</a></span></p></div><textarea name="comment" id="comment" rows="6" class="maxwidth" cols="80">66666
|
||||||
name="comment" id="comment" rows="6" class="maxwidth" cols="80">66666
|
|
||||||
|
|
||||||
1234567890</textarea></div></body></html>
|
1234567890</textarea></div></body></html>
|
@@ -4,18 +4,12 @@ http-equiv="content-type" content="text/html; charset=iso-8859-1"><meta
|
|||||||
name="author" content="Dave Shea"><meta
|
name="author" content="Dave Shea"><meta
|
||||||
name="keywords" content="design, css, cascading, style, sheets, xhtml, graphic design, w3c, web standards, visual, display"><meta
|
name="keywords" content="design, css, cascading, style, sheets, xhtml, graphic design, w3c, web standards, visual, display"><meta
|
||||||
name="description" content="A demonstration of what can be accomplished visually through CSS-based design."><meta
|
name="description" content="A demonstration of what can be accomplished visually through CSS-based design."><meta
|
||||||
name="robots" content="all"><title>css Zen Garden: The Beauty in CSS Design</title><script
|
name="robots" content="all"><title>css Zen Garden: The Beauty in CSS Design</title><script type="text/javascript">var is={ie:navigator.appName=='Microsoft Internet Explorer',java:navigator.javaEnabled(),ns:navigator.appName=='Netscape',ua:navigator.userAgent.toLowerCase(),version:parseFloat(navigator.appVersion.substr(21))||parseFloat(navigator.appVersion),win:navigator.platform=='Win32'}
|
||||||
type="text/javascript">var is={ie:navigator.appName=='Microsoft Internet Explorer',java:navigator.javaEnabled(),ns:navigator.appName=='Netscape',ua:navigator.userAgent.toLowerCase(),version:parseFloat(navigator.appVersion.substr(21))||parseFloat(navigator.appVersion),win:navigator.platform=='Win32'}
|
|
||||||
is.mac=is.ua.indexOf('mac')>=0;if(is.ua.indexOf('opera')>=0){is.ie=is.ns=false;is.opera=true;}
|
is.mac=is.ua.indexOf('mac')>=0;if(is.ua.indexOf('opera')>=0){is.ie=is.ns=false;is.opera=true;}
|
||||||
if(is.ua.indexOf('gecko')>=0){is.ie=is.ns=false;is.gecko=true;}</script><script
|
if(is.ua.indexOf('gecko')>=0){is.ie=is.ns=false;is.gecko=true;}</script><script type="text/javascript">var i=0;while(++i<10)
|
||||||
type="text/javascript">var i=0;while(++i<10)
|
{}</script><script type="text/javascript">i=1;</script><script type="text/javascript">(i<1);</script><!--[if IE 6]><style type="text/css">
|
||||||
{}</script><script
|
|
||||||
type="text/javascript">i=1;</script><script
|
|
||||||
type="text/javascript">(i<1);</script><!--[if IE 6]><style
|
|
||||||
type="text/css">
|
|
||||||
/* copyright: you'll need CDATA for this < & */
|
/* copyright: you'll need CDATA for this < & */
|
||||||
body{background:white}</style><![endif]--><style
|
body{background:white}</style><![endif]--><style type="text/css" title="currentStyle" media="screen">@import "/001/001.css";/*\*/css
|
||||||
type="text/css" title="currentStyle" media="screen">@import "/001/001.css";/*\*/css
|
|
||||||
hack{}/**//*/*/css
|
hack{}/**//*/*/css
|
||||||
hack{}/**/css
|
hack{}/**/css
|
||||||
hack{display/**/:/**/none;display:none}</style><link
|
hack{display/**/:/**/none;display:none}</style><link
|
||||||
@@ -37,7 +31,6 @@ class="p1"><span>A demonstration of what can be accomplished visually through <a
|
|||||||
title="Cascading Style Sheets">CSS</acronym>-based design. Select any style sheet from the list to load it into this page.</span></p><p
|
title="Cascading Style Sheets">CSS</acronym>-based design. Select any style sheet from the list to load it into this page.</span></p><p
|
||||||
class="p2"><span>Download the sample <a
|
class="p2"><span>Download the sample <a
|
||||||
href="/zengarden-sample.html" title="This page's source HTML code, not to be modified.">html file</a> and <a
|
href="/zengarden-sample.html" title="This page's source HTML code, not to be modified.">html file</a> and <a
|
||||||
href="/zengarden-sample.css" title="This page's sample CSS, the file you may modify.">css file</a></span></p></div><textarea
|
href="/zengarden-sample.css" title="This page's sample CSS, the file you may modify.">css file</a></span></p></div><textarea name="comment" id="comment" rows="6" class="maxwidth" cols="80">66666
|
||||||
name="comment" id="comment" rows="6" class="maxwidth" cols="80">66666
|
|
||||||
|
|
||||||
1234567890</textarea></div></body></html>
|
1234567890</textarea></div></body></html>
|
Reference in New Issue
Block a user