html-minifier
Advanced tools
Comparing version 3.1.0 to 3.1.1
{ | ||
"name": "html-minifier", | ||
"description": "Highly configurable, well-tested, JavaScript-based HTML minifier.", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "cli", |
@@ -25,15 +25,15 @@ # HTMLMinifier | ||
| --------------------------------------------------------------------------- |:--------------------:| ------------:| --------:| ----------:| ------------------:| | ||
| [Google](https://www.google.com/) | 44 | **42** | 44 | 46 | 44 | | ||
| [Google](https://www.google.com/) | 44 | **42** | 44 | 45 | 44 | | ||
| [HTMLMinifier](https://github.com/kangax/html-minifier) | 120 | **81** | 102 | 106 | 102 | | ||
| [CNN](http://www.cnn.com/) | 145 | **133** | 141 | 142 | 137 | | ||
| [BBC](http://www.bbc.co.uk/) | 168 | **137** | 161 | 165 | 157 | | ||
| [New York Times](http://www.nytimes.com/) | 188 | **126** | 139 | 140 | 133 | | ||
| [Stack Overflow](http://stackoverflow.com/) | 238 | **183** | 193 | 200 | 190 | | ||
| [CNN](http://www.cnn.com/) | 133 | **121** | 129 | 130 | 125 | | ||
| [Amazon](http://www.amazon.co.uk/) | 171 | **139** | 163 | 166 | n/a | | ||
| [BBC](http://www.bbc.co.uk/) | 178 | **145** | 171 | 174 | 166 | | ||
| [New York Times](http://www.nytimes.com/) | 195 | **129** | 144 | 146 | 138 | | ||
| [Stack Overflow](http://stackoverflow.com/) | 242 | **186** | 196 | 204 | 193 | | ||
| [Bootstrap CSS](http://getbootstrap.com/css/) | 276 | **264** | 273 | 231 | 274 | | ||
| [Amazon](http://www.amazon.co.uk/) | 369 | **313** | 352 | 360 | n/a | | ||
| [Wikipedia](https://en.wikipedia.org/wiki/President_of_the_United_States) | 490 | **447** | 474 | 488 | n/a | | ||
| [NBC](http://www.nbc.com/) | 541 | **519** | 539 | 541 | n/a | | ||
| [Eloquent Javascript](http://eloquentjavascript.net/1st_edition/print.html) | 870 | **815** | 840 | 864 | n/a | | ||
| [ES6 table](http://kangax.github.io/compat-table/es6/) | 4087 | **3446** | 3859 | 4039 | n/a | | ||
| [ES6 draft](https://tc39.github.io/ecma262/) | 4869 | **4326** | 4455 | 4579 | n/a | | ||
| [Wikipedia](https://en.wikipedia.org/wiki/President_of_the_United_States) | 493 | **449** | 477 | 491 | n/a | | ||
| [NBC](http://www.nbc.com/) | 551 | **529** | 549 | 551 | n/a | | ||
| [Eloquent Javascript](http://eloquentjavascript.net/1st_edition/print.html) | 870 | **815** | 840 | n/a | n/a | | ||
| [ES6 table](http://kangax.github.io/compat-table/es6/) | 4204 | **3541** | 3966 | n/a | n/a | | ||
| [ES6 draft](https://tc39.github.io/ecma262/) | 4873 | **4329** | 4459 | n/a | n/a | | ||
@@ -60,3 +60,3 @@ ## Options Quick Reference | ||
| `maxLineLength` | Specify a maximum line length. Compressed output will be split by newlines at valid HTML split-points | | ||
| `minifyCSS` | Minify CSS in style elements and style attributes (uses [clean-css](https://github.com/jakubpawlowicz/clean-css)) | `false` (could be `true`, `Object`, `Function(text)`) | | ||
| `minifyCSS` | Minify CSS in style elements and style attributes (uses [clean-css](https://github.com/jakubpawlowicz/clean-css)). `advanced` optimisations are disabled by default | `false` (could be `true`, `Object`, `Function(text)`) | | ||
| `minifyJS` | Minify JavaScript in script elements and event attributes (uses [UglifyJS](https://github.com/mishoo/UglifyJS2)) | `false` (could be `true`, `Object`, `Function(text, inline)`) | | ||
@@ -63,0 +63,0 @@ | `minifyURLs` | Minify URLs in various attributes (uses [relateurl](https://github.com/stevenvachon/relateurl)) | `false` (could be `String`, `Object`, `Function(text)`) | |
@@ -81,3 +81,3 @@ 'use strict'; | ||
function isConditionalComment(text) { | ||
return /^\[if\s[^\]]+\]|\[endif\]$/.test(text); | ||
return /^\[if\s[^\]]+]|\[endif]$/.test(text); | ||
} | ||
@@ -355,3 +355,3 @@ | ||
function cleanConditionalComment(comment, options) { | ||
return options.processConditionalComments ? comment.replace(/^(\[if\s[^\]]+\]>)([\s\S]*?)(<!\[endif\])$/, function(match, prefix, text, suffix) { | ||
return options.processConditionalComments ? comment.replace(/^(\[if\s[^\]]+]>)([\s\S]*?)(<!\[endif])$/, function(match, prefix, text, suffix) { | ||
return prefix + minify(text, options, true) + suffix; | ||
@@ -874,5 +874,5 @@ }) : comment; | ||
if (customFragments.length) { | ||
var reCustomIgnore = new RegExp('(\\s*)(?:' + customFragments.join('|') + ')+(\\s*)', 'g'); | ||
var reCustomIgnore = new RegExp('\\s*(?:' + customFragments.join('|') + ')+\\s*', 'g'); | ||
// temporarily replace custom ignored fragments with unique attributes | ||
value = value.replace(reCustomIgnore, function(match, prefix, suffix) { | ||
value = value.replace(reCustomIgnore, function(match) { | ||
if (!uidAttr) { | ||
@@ -895,3 +895,3 @@ uidAttr = uniqueId(value); | ||
var token = uidAttr + ignoredCustomMarkupChunks.length; | ||
ignoredCustomMarkupChunks.push([match, prefix, suffix]); | ||
ignoredCustomMarkupChunks.push(/^(\s*)[\s\S]*?(\s*)$/.exec(match)); | ||
return '\t' + token + '\t'; | ||
@@ -898,0 +898,0 @@ }); |
@@ -40,3 +40,3 @@ /*! | ||
// Regular Expressions for parsing tags and attributes | ||
var singleAttrIdentifier = /([^\s"'<>\/=]+)/, | ||
var singleAttrIdentifier = /([^\s"'<>/=]+)/, | ||
singleAttrAssign = /=/, | ||
@@ -223,3 +223,3 @@ singleAttrAssigns = [singleAttrAssign], | ||
.replace(/<!--([\s\S]*?)-->/g, '$1') | ||
.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, '$1'); | ||
.replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1'); | ||
} | ||
@@ -226,0 +226,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
87820