From 6748ef2f392228b8ea05043ed01889c777e96154 Mon Sep 17 00:00:00 2001 From: kangax Date: Tue, 21 Jan 2014 14:02:16 -0500 Subject: [PATCH] Version 0.5.5 --- dist/all.js | 8 +++++--- index.html | 2 +- package.json | 2 +- src/htmlminifier.js | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dist/all.js b/dist/all.js index 844e217..4f7ef2d 100644 --- a/dist/all.js +++ b/dist/all.js @@ -365,7 +365,7 @@ } })(typeof exports === 'undefined' ? this : exports); /*! - * HTMLMinifier v0.5.4 + * HTMLMinifier v0.5.5 * http://kangax.github.com/html-minifier/ * * Copyright (c) 2010-2013 Juriy "kangax" Zaytsev @@ -408,7 +408,7 @@ function collapseWhitespaceSmart(str, prevTag, nextTag) { // array of tags that will maintain a single space outside of them - var tags = ['a', 'abbr', 'acronym', 'b', 'big', 'button', 'code', 'del', 'dfn', 'em', 'font', 'i', 'ins', 'kbd', 'mark', 'q', 's', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'time', 'tt', 'u', 'var']; + var tags = ['a', 'abbr', 'acronym', 'b', 'bdi', 'bdo', 'big', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', 'ins', 'kbd', 'mark', 'q', 'rt', 'rp', 's', 'samp', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'time', 'tt', 'u', 'var']; if (prevTag && prevTag !== 'img' && (prevTag.substr(0,1) !== '/' || ( prevTag.substr(0,1) === '/' && tags.indexOf(prevTag.substr(1)) === -1))) { @@ -442,7 +442,9 @@ function canRemoveAttributeQuotes(value) { // http://mathiasbynens.be/notes/unquoted-attribute-values - return (/^[^\x20\t\n\f\r"'`=<>]+$/).test(value); + return (/^[^\x20\t\n\f\r"'`=<>]+$/).test(value) && !(/\/$/ ).test(value) && + // make sure trailing slash is not interpreted as HTML self-closing tag + !(/\/$/).test(value); } function attributesInclude(attributes, attribute) { diff --git a/index.html b/index.html index cec7988..b9dda8d 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@
-

HTML Minifier (v0.5.4)

+

HTML Minifier (v0.5.5)

Minifier is in beta and is not yet thoroughly tested. Use at your own risk.

diff --git a/package.json b/package.json index 48c4d45..cf5e87c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "html-minifier", "description": "HTML minifier with lint-like capabilities.", - "version": "0.5.4", + "version": "0.5.5", "keywords": ["html", "minifier", "lint"], "url" : "http://github.com/kangax/html-minifier", "maintainers": [{ diff --git a/src/htmlminifier.js b/src/htmlminifier.js index 168ac2f..7b05ccb 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -1,5 +1,5 @@ /*! - * HTMLMinifier v0.5.4 + * HTMLMinifier v0.5.5 * http://kangax.github.com/html-minifier/ * * Copyright (c) 2010-2013 Juriy "kangax" Zaytsev -- 2.34.1