html-minifier
Advanced tools
Comparing version 0.5.4 to 0.5.5
@@ -368,3 +368,3 @@ /* | ||
/*! | ||
* HTMLMinifier v0.5.4 | ||
* HTMLMinifier v0.5.5 | ||
* http://kangax.github.com/html-minifier/ | ||
@@ -412,3 +412,3 @@ * | ||
// 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', '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']; | ||
@@ -427,3 +427,3 @@ if (prevTag && prevTag !== 'img' && (prevTag.substr(0,1) !== '/' | ||
// strip non space whitespace then compress spaces to one | ||
return str.replace(/[\t\n\r]+/g, '').replace(/[ ]+/g, ' '); | ||
return str.replace(/[\t\n\r]+/g, ' ').replace(/[ ]+/g, ' '); | ||
} | ||
@@ -448,3 +448,5 @@ | ||
// 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); | ||
} | ||
@@ -451,0 +453,0 @@ |
{ | ||
"name": "html-minifier", | ||
"description": "HTML minifier with lint-like capabilities.", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"keywords": ["html", "minifier", "lint"], | ||
@@ -6,0 +6,0 @@ "url" : "http://github.com/kangax/html-minifier", |
@@ -18,1 +18,3 @@ [HTMLMinifier](http://kangax.github.com/html-minifier/) is a Javascript-based HTML minifier (duh), with lint-like capabilities. | ||
> npm test | ||
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/kangax/html-minifier/trend.png)](https://bitdeli.com/free "Bitdeli Badge") |
/*! | ||
* HTMLMinifier v0.5.4 | ||
* HTMLMinifier v0.5.5 | ||
* http://kangax.github.com/html-minifier/ | ||
@@ -45,3 +45,3 @@ * | ||
// 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', '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']; | ||
@@ -60,3 +60,3 @@ if (prevTag && prevTag !== 'img' && (prevTag.substr(0,1) !== '/' | ||
// strip non space whitespace then compress spaces to one | ||
return str.replace(/[\t\n\r]+/g, '').replace(/[ ]+/g, ' '); | ||
return str.replace(/[\t\n\r]+/g, ' ').replace(/[ ]+/g, ' '); | ||
} | ||
@@ -81,3 +81,5 @@ | ||
// 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); | ||
} | ||
@@ -84,0 +86,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65119
1628
20