Skip to content

Commit 27d8341

Browse files
committed
Version 3.3.3
1 parent eef258a commit 27d8341

File tree

5 files changed

+31
-29
lines changed

5 files changed

+31
-29
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ How does HTMLMinifier compare to other solutions — [HTML Minifier from Will Pe
2222

2323
| Site | Original size *(KB)* | HTMLMinifier | minimize | Will Peavy | htmlcompressor.com |
2424
| --------------------------------------------------------------------------- |:--------------------:| ------------:| --------:| ----------:| ------------------:|
25-
| [Google](https://www.google.com/) | 44 | **42** | 44 | 46 | 44 |
26-
| [HTMLMinifier](https://github.com/kangax/html-minifier) | 122 | **95** | 103 | 107 | 103 |
27-
| [CNN](http://www.cnn.com/) | 134 | **123** | 132 | 133 | 127 |
28-
| [Amazon](http://www.amazon.co.uk/) | 190 | **158** | 182 | 185 | n/a |
29-
| [New York Times](http://www.nytimes.com/) | 209 | **138** | 157 | 156 | 146 |
25+
| [Google](https://www.google.com/) | 44 | **42** | 44 | 46 | 45 |
26+
| [HTMLMinifier](https://github.com/kangax/html-minifier) | 122 | **96** | 104 | 108 | 103 |
27+
| [CNN](http://www.cnn.com/) | 134 | **124** | 132 | 133 | 128 |
28+
| [Amazon](http://www.amazon.co.uk/) | 204 | **166** | 195 | 195 | n/a |
29+
| [New York Times](http://www.nytimes.com/) | 208 | **137** | 157 | 155 | 146 |
3030
| [BBC](http://www.bbc.co.uk/) | 214 | **178** | 207 | 213 | 202 |
31-
| [Stack Overflow](http://stackoverflow.com/) | 240 | **188** | 198 | 206 | 195 |
31+
| [Stack Overflow](http://stackoverflow.com/) | 240 | **188** | 198 | 206 | 196 |
3232
| [Bootstrap CSS](http://getbootstrap.com/css/) | 272 | **260** | 269 | 229 | 269 |
33-
| [Wikipedia](https://en.wikipedia.org/wiki/President_of_the_United_States) | 546 | **493** | 527 | 545 | 526 |
34-
| [NBC](http://www.nbc.com/) | 566 | **543** | 565 | 566 | 549 |
33+
| [Wikipedia](https://en.wikipedia.org/wiki/President_of_the_United_States) | 546 | **499** | 527 | 545 | 526 |
34+
| [NBC](http://www.nbc.com/) | 566 | **544** | 565 | 567 | 549 |
3535
| [Eloquent Javascript](http://eloquentjavascript.net/1st_edition/print.html) | 870 | **815** | 840 | 864 | n/a |
3636
| [ES6 table](http://kangax.github.io/compat-table/es6/) | 4197 | **3531** | 3959 | n/a | n/a |
37-
| [ES6 draft](https://tc39.github.io/ecma262/) | 5507 | **4911** | 5060 | n/a | n/a |
37+
| [ES6 draft](https://tc39.github.io/ecma262/) | 5507 | **4914** | 5060 | n/a | n/a |
3838

3939
## Options Quick Reference
4040

dist/htmlminifier.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* HTMLMinifier v3.3.2 (http://kangax.github.io/html-minifier/)
2+
* HTMLMinifier v3.3.3 (http://kangax.github.io/html-minifier/)
33
* Copyright 2010-2017 Juriy "kangax" Zaytsev
44
* Licensed under the MIT license
55
*/
@@ -32197,20 +32197,10 @@ var trimWhitespace = String.prototype.trim ? function(str) {
3219732197
return str.replace(/^\s+/, '').replace(/\s+$/, '');
3219832198
};
3219932199

32200-
function compressWhitespace(spaces) {
32201-
return spaces === '\t' ? '\t' : spaces.replace(/(^|\xA0+)[^\xA0]+/g, '$1 ');
32202-
}
32203-
3220432200
function collapseWhitespaceAll(str) {
32205-
return str && str.replace(/\s+/g, compressWhitespace);
32206-
}
32207-
32208-
function compressWhitespaceLeft(spaces) {
32209-
return spaces === '\t' ? '\t' : spaces.replace(/^[^\xA0]+/, '').replace(/(\xA0+)[^\xA0]+/g, '$1 ') || ' ';
32210-
}
32211-
32212-
function compressWhitespaceRight(spaces) {
32213-
return spaces === '\t' ? '\t' : spaces.replace(/[^\xA0]+(\xA0+)/g, ' $1').replace(/[^\xA0]+$/, '') || ' ';
32201+
return str && str.replace(/\s+/g, function(spaces) {
32202+
return spaces === '\t' ? '\t' : spaces.replace(/(^|\xA0+)[^\xA0]+/g, '$1 ');
32203+
});
3221432204
}
3221532205

3221632206
function collapseWhitespace(str, options, trimLeft, trimRight, collapseAll) {
@@ -32227,11 +32217,23 @@ function collapseWhitespace(str, options, trimLeft, trimRight, collapseAll) {
3222732217
}
3222832218

3222932219
if (trimLeft) {
32230-
str = str.replace(/^\s+/, !lineBreakBefore && options.conservativeCollapse ? compressWhitespaceLeft : '');
32220+
str = str.replace(/^\s+/, function(spaces) {
32221+
var conservative = !lineBreakBefore && options.conservativeCollapse;
32222+
if (conservative && spaces === '\t') {
32223+
return '\t';
32224+
}
32225+
return spaces.replace(/^[^\xA0]+/, '').replace(/(\xA0+)[^\xA0]+/g, '$1 ') || (conservative ? ' ' : '');
32226+
});
3223132227
}
3223232228

3223332229
if (trimRight) {
32234-
str = str.replace(/\s+$/, !lineBreakAfter && options.conservativeCollapse ? compressWhitespaceRight : '');
32230+
str = str.replace(/\s+$/, function(spaces) {
32231+
var conservative = !lineBreakAfter && options.conservativeCollapse;
32232+
if (conservative && spaces === '\t') {
32233+
return '\t';
32234+
}
32235+
return spaces.replace(/[^\xA0]+(\xA0+)/g, ' $1').replace(/[^\xA0]+$/, '') || (conservative ? ' ' : '');
32236+
});
3223532237
}
3223632238

3223732239
if (collapseAll) {

dist/htmlminifier.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<body>
1010
<div id="outer-wrapper">
1111
<div id="wrapper">
12-
<h1>HTML Minifier <span>(v3.3.2)</span></h1>
12+
<h1>HTML Minifier <span>(v3.3.3)</span></h1>
1313
<textarea rows="8" cols="40" id="input"></textarea>
1414
<div class="minify-button">
1515
<button type="button" id="minify-btn">Minify</button>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "html-minifier",
33
"description": "Highly configurable, well-tested, JavaScript-based HTML minifier.",
4-
"version": "3.3.2",
4+
"version": "3.3.3",
55
"keywords": [
66
"cli",
77
"compress",

0 commit comments

Comments
 (0)