1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-19 04:11:20 +02:00

Minify_HTML: shorter line lengths

This commit is contained in:
Steve Clay
2008-08-16 21:24:33 +00:00
parent 348c838c8b
commit 50128e5600
2 changed files with 28 additions and 12 deletions

View File

@@ -77,9 +77,6 @@ class Minify_HTML {
.'|ol|opt(?:group|ion)|p|param|t(?:able|body|head|d|h||r|foot|itle)'
.'|ul)\\b[^>]*>)/i', '$1', $html);
// line break within some tags to limit line lengths
$html = preg_replace('/(<(?:div|span|a|p|input)) ([^>]+>)/i', "$1\n$2", $html);
// remove ws outside of all elements
$html = preg_replace_callback(
'/>([^<]+)</'
@@ -90,7 +87,10 @@ class Minify_HTML {
self::_fillPlaceholders($html, self::$_pres, 'PRE');
self::_fillPlaceholders($html, self::$_tas, 'TEXTAREA');
self::_fillPlaceholders($html, self::$_scripts, 'SCRIPT');
self::_fillPlaceholders($html, self::$_styles, 'STYLE');
self::_fillPlaceholders($html, self::$_styles, 'STYLE');
// 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;