From 6e8a65648014e9f069f18144093c808bc1fc9d44 Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Tue, 29 Sep 2015 15:45:24 -0400 Subject: [PATCH] Add HTML5 block level elements to Minify_HTML Fixes #424 --- lib/Minify/HTML.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Minify/HTML.php b/lib/Minify/HTML.php index 40f7307..2b0a4ab 100644 --- a/lib/Minify/HTML.php +++ b/lib/Minify/HTML.php @@ -130,11 +130,11 @@ class Minify_HTML { $this->_html = preg_replace('/^\\s+|\\s+$/m', '', $this->_html); // remove ws around block/undisplayed elements - $this->_html = preg_replace('/\\s+(<\\/?(?:area|base(?:font)?|blockquote|body' - .'|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|form' - .'|frame(?:set)?|h[1-6]|head|hr|html|legend|li|link|map|menu|meta' - .'|ol|opt(?:group|ion)|p|param|t(?:able|body|head|d|h||r|foot|itle)' - .'|ul)\\b[^>]*>)/i', '$1', $this->_html); + $this->_html = preg_replace('/\\s+(<\\/?(?:area|article|aside|base(?:font)?|blockquote|body' + .'|canvas|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|figcaption|figure|footer|form' + .'|frame(?:set)?|h[1-6]|head|header|hgroup|hr|html|legend|li|link|main|map|menu|meta|nav' + .'|ol|opt(?:group|ion)|output|p|param|section|t(?:able|body|head|d|h||r|foot|itle)' + .'|ul|video)\\b[^>]*>)/i', '$1', $this->_html); // remove ws outside of all elements $this->_html = preg_replace(