html-minifier
Advanced tools
Comparing version 3.5.18 to 3.5.19
{ | ||
"name": "html-minifier", | ||
"description": "Highly configurable, well-tested, JavaScript-based HTML minifier.", | ||
"version": "3.5.18", | ||
"version": "3.5.19", | ||
"keywords": [ | ||
@@ -26,7 +26,7 @@ "cli", | ||
], | ||
"homepage": "http://kangax.github.io/html-minifier/", | ||
"homepage": "https://kangax.github.io/html-minifier/", | ||
"author": "Juriy \"kangax\" Zaytsev", | ||
"maintainers": [ | ||
"Alex Lam <alexlamsl@gmail.com>", | ||
"Juriy Zaytsev <kangax@gmail.com> (http://perfectionkills.com)" | ||
"Juriy Zaytsev <kangax@gmail.com> (http://perfectionkills.com/)" | ||
], | ||
@@ -33,0 +33,0 @@ "contributors": [ |
@@ -7,7 +7,7 @@ # HTMLMinifier | ||
[HTMLMinifier](http://kangax.github.io/html-minifier/) is a highly **configurable**, **well-tested**, JavaScript-based HTML minifier. | ||
[HTMLMinifier](https://kangax.github.io/html-minifier/) is a highly **configurable**, **well-tested**, JavaScript-based HTML minifier. | ||
See [corresponding blog post](http://perfectionkills.com/experimenting-with-html-minifier/) for all the gory details of [how it works](http://perfectionkills.com/experimenting-with-html-minifier/#how_it_works), [description of each option](http://perfectionkills.com/experimenting-with-html-minifier/#options), [testing results](http://perfectionkills.com/experimenting-with-html-minifier/#field_testing) and [conclusions](http://perfectionkills.com/experimenting-with-html-minifier/#cost_and_benefits). | ||
[Test suite is available online](http://kangax.github.io/html-minifier/tests/). | ||
[Test suite is available online](https://kangax.github.io/html-minifier/tests/). | ||
@@ -24,15 +24,15 @@ Also see corresponding [Ruby wrapper](https://github.com/stereobooster/html_minifier), and for Node.js, [Grunt plugin](https://github.com/gruntjs/grunt-contrib-htmlmin), [Gulp module](https://github.com/jonschlinkert/gulp-htmlmin), [Koa middleware wrapper](https://github.com/koajs/html-minifier) and [Express middleware wrapper](https://github.com/melonmanchan/express-minify-html). | ||
| ---------------------------------------------------------------------------- |:--------------------:| ------------:| --------:| ----------:| ------------------:| | ||
| [Google](https://www.google.com/) | 47 | **43** | 47 | 50 | 47 | | ||
| [Twitter](https://twitter.com/) | 139 | **104** | 132 | 152 | 132 | | ||
| [HTMLMinifier](https://github.com/kangax/html-minifier) | 149 | **116** | 124 | 129 | 124 | | ||
| [New York Times](https://www.nytimes.com/) | 225 | **154** | 175 | 170 | 158 | | ||
| [Stack Overflow](https://stackoverflow.com/) | 253 | **196** | 206 | 215 | 204 | | ||
| [Google](https://www.google.com/) | 46 | **42** | 46 | 48 | 46 | | ||
| [Twitter](https://twitter.com/) | 143 | **107** | 136 | 157 | 136 | | ||
| [HTMLMinifier](https://github.com/kangax/html-minifier) | 152 | **119** | 127 | 132 | 127 | | ||
| [New York Times](https://www.nytimes.com/) | 223 | **152** | 173 | 168 | 156 | | ||
| [Stack Overflow](https://stackoverflow.com/) | 258 | **201** | 211 | 220 | 208 | | ||
| [Bootstrap CSS](https://getbootstrap.com/docs/3.3/css/) | 271 | **260** | 269 | 229 | 269 | | ||
| [BBC](https://www.bbc.co.uk/) | 287 | **231** | 279 | 281 | 272 | | ||
| [Amazon](https://www.amazon.co.uk/) | 438 | **378** | 424 | 436 | n/a | | ||
| [Wikipedia](https://en.wikipedia.org/wiki/President_of_the_United_States) | 484 | **451** | 468 | 484 | 467 | | ||
| [NBC](https://www.nbc.com/) | 692 | **651** | 688 | 691 | n/a | | ||
| [BBC](https://www.bbc.co.uk/) | 299 | **242** | 290 | 293 | 283 | | ||
| [Amazon](https://www.amazon.co.uk/) | 398 | **342** | 385 | 397 | n/a | | ||
| [Wikipedia](https://en.wikipedia.org/wiki/President_of_the_United_States) | 485 | **452** | 470 | 487 | 469 | | ||
| [NBC](https://www.nbc.com/) | 679 | **639** | 675 | 678 | n/a | | ||
| [Eloquent Javascript](https://eloquentjavascript.net/1st_edition/print.html) | 870 | **815** | 840 | 864 | n/a | | ||
| [ES6 table](https://kangax.github.io/compat-table/es6/) | 5068 | **4320** | 4797 | n/a | n/a | | ||
| [ES6 draft](https://tc39.github.io/ecma262/) | 6051 | **5431** | 5595 | n/a | n/a | | ||
| [ES6 table](https://kangax.github.io/compat-table/es6/) | 5109 | **4353** | 4834 | n/a | n/a | | ||
| [ES6 draft](https://tc39.github.io/ecma262/) | 6063 | **5443** | 5607 | n/a | n/a | | ||
@@ -39,0 +39,0 @@ ## Options Quick Reference |
@@ -112,3 +112,3 @@ 'use strict'; | ||
function canRemoveAttributeQuotes(value) { | ||
// http://mathiasbynens.be/notes/unquoted-attribute-values | ||
// https://mathiasbynens.be/notes/unquoted-attribute-values | ||
return /^[^ \t\n\f\r"'`=<>]+$/.test(value); | ||
@@ -378,3 +378,3 @@ } | ||
// - retain <body> if followed by <noscript> | ||
// - </rb>, </rt>, </rtc>, </rp> & </tfoot> follow http://www.w3.org/TR/html5/syntax.html#optional-tags | ||
// - </rb>, </rt>, </rtc>, </rp> & </tfoot> follow https://www.w3.org/TR/html5/syntax.html#optional-tags | ||
// - retain all tags which are adjacent to non-standard HTML tags | ||
@@ -1225,3 +1225,3 @@ var optionalStartTags = createMapFromString('html,head,body,colgroup,tbody'); | ||
doctype: function(doctype) { | ||
buffer.push(options.useShortDoctype ? '<!DOCTYPE html>' : collapseWhitespaceAll(doctype)); | ||
buffer.push(options.useShortDoctype ? '<!doctype html>' : collapseWhitespaceAll(doctype)); | ||
}, | ||
@@ -1247,6 +1247,4 @@ customAttrAssign: options.customAttrAssign, | ||
var str = joinResultSegments(buffer, options); | ||
if (uidPattern) { | ||
str = str.replace(uidPattern, function(match, prefix, index, suffix) { | ||
return joinResultSegments(buffer, options, uidPattern ? function(str) { | ||
return str.replace(uidPattern, function(match, prefix, index, suffix) { | ||
var chunk = ignoredCustomMarkupChunks[+index][0]; | ||
@@ -1267,13 +1265,10 @@ if (options.collapseWhitespace) { | ||
}); | ||
} | ||
if (uidIgnore) { | ||
str = str.replace(new RegExp('<!--' + uidIgnore + '([0-9]+)-->', 'g'), function(match, index) { | ||
} : identity, uidIgnore ? function(str) { | ||
return str.replace(new RegExp('<!--' + uidIgnore + '([0-9]+)-->', 'g'), function(match, index) { | ||
return ignoredMarkupChunks[+index]; | ||
}); | ||
} | ||
return str; | ||
} : identity); | ||
} | ||
function joinResultSegments(results, options) { | ||
function joinResultSegments(results, options, restoreCustom, restoreIgnore) { | ||
var str; | ||
@@ -1287,9 +1282,9 @@ var maxLineLength = options.maxLineLength; | ||
if (end < 0) { | ||
line += results.shift(); | ||
line += restoreIgnore(restoreCustom(results.shift())); | ||
} | ||
else { | ||
line += results[0].slice(0, end); | ||
line += restoreIgnore(restoreCustom(results[0].slice(0, end))); | ||
results[0] = results[0].slice(end + 1); | ||
} | ||
if (len > 0 && line.length >= maxLineLength) { | ||
if (len > 0 && line.length > maxLineLength) { | ||
lines.push(line.slice(0, len)); | ||
@@ -1306,7 +1301,6 @@ line = line.slice(len); | ||
} | ||
str = lines.join('\n'); | ||
} | ||
else { | ||
str = results.join(''); | ||
str = restoreIgnore(restoreCustom(results.join(''))); | ||
} | ||
@@ -1313,0 +1307,0 @@ return options.collapseWhitespace ? collapseWhitespace(str, options, true, true) : str; |
@@ -143,3 +143,3 @@ /*! | ||
// http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment | ||
// https://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment | ||
if (/^<!\[/.test(html)) { | ||
@@ -146,0 +146,0 @@ var conditionalEnd = html.indexOf(']>'); |
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
93713
2088