html-minifier
Advanced tools
Comparing version 3.4.1 to 3.4.2
{ | ||
"name": "html-minifier", | ||
"description": "Highly configurable, well-tested, JavaScript-based HTML minifier.", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "cli", |
@@ -25,12 +25,12 @@ # HTMLMinifier | ||
| --------------------------------------------------------------------------- |:--------------------:| ------------:| --------:| ----------:| ------------------:| | ||
| [Google](https://www.google.com/) | 44 | **42** | 44 | 46 | 45 | | ||
| [HTMLMinifier](https://github.com/kangax/html-minifier) | 123 | **96** | 104 | 108 | 104 | | ||
| [CNN](http://www.cnn.com/) | 135 | **125** | 133 | 134 | 128 | | ||
| [Amazon](http://www.amazon.co.uk/) | 193 | **161** | 184 | 187 | n/a | | ||
| [New York Times](http://www.nytimes.com/) | 205 | **137** | 154 | 155 | 145 | | ||
| [BBC](http://www.bbc.co.uk/) | 206 | **171** | 199 | 204 | 194 | | ||
| [Stack Overflow](http://stackoverflow.com/) | 223 | **173** | 182 | 190 | 179 | | ||
| [Google](https://www.google.com/) | 44 | **42** | 45 | 46 | 45 | | ||
| [HTMLMinifier](https://github.com/kangax/html-minifier) | 124 | **97** | 105 | 109 | 104 | | ||
| [CNN](http://www.cnn.com/) | 130 | **119** | 127 | 128 | 123 | | ||
| [Amazon](http://www.amazon.co.uk/) | 195 | **163** | 186 | 189 | n/a | | ||
| [New York Times](http://www.nytimes.com/) | 216 | **146** | 163 | 164 | 154 | | ||
| [Stack Overflow](http://stackoverflow.com/) | 223 | **172** | 181 | 188 | 178 | | ||
| [BBC](http://www.bbc.co.uk/) | 227 | **188** | 220 | 226 | 215 | | ||
| [Bootstrap CSS](http://getbootstrap.com/css/) | 272 | **260** | 269 | 229 | 269 | | ||
| [Wikipedia](https://en.wikipedia.org/wiki/President_of_the_United_States) | 545 | **498** | 526 | 544 | 525 | | ||
| [NBC](http://www.nbc.com/) | 560 | **538** | 558 | 560 | 543 | | ||
| [NBC](http://www.nbc.com/) | 567 | **544** | 565 | 567 | 549 | | ||
| [Eloquent Javascript](http://eloquentjavascript.net/1st_edition/print.html) | 870 | **815** | 840 | 864 | n/a | | ||
@@ -37,0 +37,0 @@ | [ES6 table](http://kangax.github.io/compat-table/es6/) | 4287 | **3607** | 4044 | n/a | n/a | |
@@ -41,4 +41,3 @@ /*! | ||
var singleAttrIdentifier = /([^\s"'<>/=]+)/, | ||
singleAttrAssign = /=/, | ||
singleAttrAssigns = [singleAttrAssign], | ||
singleAttrAssigns = [/=/], | ||
singleAttrValues = [ | ||
@@ -50,3 +49,3 @@ // attr value double quotes | ||
// attr value, no quotes | ||
/([^\s"'=<>`]+)/.source | ||
/([^ \t\n\f\r"'`=<>]+)/.source | ||
], | ||
@@ -93,3 +92,3 @@ // https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName | ||
'(?:\\s*(' + joinSingleAttrAssigns(handler) + ')' + | ||
'\\s*(?:' + singleAttrValues.join('|') + '))?'; | ||
'[ \\t\\n\\f\\r]*(?:' + singleAttrValues.join('|') + '))?'; | ||
if (handler.customAttrSurround) { | ||
@@ -96,0 +95,0 @@ var attrClauses = []; |
@@ -8,4 +8,5 @@ 'use strict'; | ||
fromIndex = fromIndex || 0; | ||
for (var i = 0, len = this.tokens.length; i < len; i++) { | ||
var token = this.tokens[i]; | ||
for (var i = 0, len = this.keys.length; i < len; i++) { | ||
var key = this.keys[i]; | ||
var token = key.slice(1); | ||
var index = tokens.indexOf(token, fromIndex); | ||
@@ -20,3 +21,3 @@ if (index !== -1) { | ||
} while ((index = tokens.indexOf(token, fromIndex)) !== -1); | ||
return this[token].sort(tokens, fromIndex); | ||
return this[key].sort(tokens, fromIndex); | ||
} | ||
@@ -34,7 +35,8 @@ } | ||
tokens.forEach(function(token) { | ||
if (!self[token]) { | ||
self[token] = []; | ||
self[token].processed = 0; | ||
var key = '$' + token; | ||
if (!self[key]) { | ||
self[key] = []; | ||
self[key].processed = 0; | ||
} | ||
self[token].push(tokens); | ||
self[key].push(tokens); | ||
}); | ||
@@ -45,10 +47,11 @@ }, | ||
var sorter = new Sorter(); | ||
sorter.tokens = Object.keys(this).sort(function(j, k) { | ||
sorter.keys = Object.keys(self).sort(function(j, k) { | ||
var m = self[j].length; | ||
var n = self[k].length; | ||
return m < n ? 1 : m > n ? -1 : j < k ? -1 : j > k ? 1 : 0; | ||
}).filter(function(token) { | ||
if (self[token].processed < self[token].length) { | ||
}).filter(function(key) { | ||
if (self[key].processed < self[key].length) { | ||
var token = key.slice(1); | ||
var chain = new TokenChain(); | ||
self[token].forEach(function(tokens) { | ||
self[key].forEach(function(tokens) { | ||
var index; | ||
@@ -59,7 +62,7 @@ while ((index = tokens.indexOf(token)) !== -1) { | ||
tokens.forEach(function(token) { | ||
self[token].processed++; | ||
self['$' + token].processed++; | ||
}); | ||
chain.add(tokens.slice(0)); | ||
}); | ||
sorter[token] = chain.createSorter(); | ||
sorter[key] = chain.createSorter(); | ||
return true; | ||
@@ -66,0 +69,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
88199
2027