html-minifier 3.5.1 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/package.json +1 -1
- package/src/htmlminifier.js +2 -2
package/README.md
CHANGED
|
@@ -22,16 +22,16 @@ How does HTMLMinifier compare to other solutions — [HTML Minifier from Will Pe
|
|
|
22
22
|
|
|
23
23
|
| Site | Original size *(KB)* | HTMLMinifier | minimize | Will Peavy | htmlcompressor.com |
|
|
24
24
|
| --------------------------------------------------------------------------- |:--------------------:| ------------:| --------:| ----------:| ------------------:|
|
|
25
|
-
| [Google](https://www.google.com/) |
|
|
26
|
-
| [HTMLMinifier](https://github.com/kangax/html-minifier) |
|
|
27
|
-
| [CNN](http://www.cnn.com/) |
|
|
28
|
-
| [Amazon](http://www.amazon.co.uk/) |
|
|
29
|
-
| [Stack Overflow](http://stackoverflow.com/) |
|
|
30
|
-
| [
|
|
31
|
-
| [
|
|
25
|
+
| [Google](https://www.google.com/) | 46 | **43** | 46 | 48 | 46 |
|
|
26
|
+
| [HTMLMinifier](https://github.com/kangax/html-minifier) | 129 | **100** | 108 | 113 | 108 |
|
|
27
|
+
| [CNN](http://www.cnn.com/) | 134 | **123** | 131 | 132 | 127 |
|
|
28
|
+
| [Amazon](http://www.amazon.co.uk/) | 200 | **168** | 192 | 195 | n/a |
|
|
29
|
+
| [Stack Overflow](http://stackoverflow.com/) | 220 | **170** | 178 | 186 | 176 |
|
|
30
|
+
| [BBC](http://www.bbc.co.uk/) | 228 | **188** | 221 | 228 | 216 |
|
|
31
|
+
| [New York Times](http://www.nytimes.com/) | 235 | **158** | 181 | 178 | 165 |
|
|
32
32
|
| [Bootstrap CSS](http://getbootstrap.com/css/) | 272 | **260** | 269 | 229 | 269 |
|
|
33
|
-
| [Wikipedia](https://en.wikipedia.org/wiki/President_of_the_United_States) | 550 | **
|
|
34
|
-
| [NBC](http://www.nbc.com/) |
|
|
33
|
+
| [Wikipedia](https://en.wikipedia.org/wiki/President_of_the_United_States) | 550 | **502** | 530 | 548 | 529 |
|
|
34
|
+
| [NBC](http://www.nbc.com/) | 649 | **617** | 646 | 649 | n/a |
|
|
35
35
|
| [Eloquent Javascript](http://eloquentjavascript.net/1st_edition/print.html) | 870 | **815** | 840 | 864 | n/a |
|
|
36
36
|
| [ES6 table](http://kangax.github.io/compat-table/es6/) | 4105 | **3467** | 3871 | n/a | n/a |
|
|
37
37
|
| [ES6 draft](https://tc39.github.io/ecma262/) | 5512 | **4919** | 5066 | n/a | n/a |
|
package/package.json
CHANGED
package/src/htmlminifier.js
CHANGED
|
@@ -998,10 +998,10 @@ function minify(value, options, partialMarkup) {
|
|
|
998
998
|
if (!stackNoTrimWhitespace.length) {
|
|
999
999
|
squashTrailingWhitespace(tag);
|
|
1000
1000
|
}
|
|
1001
|
-
if (!_canTrimWhitespace(tag, attrs)) {
|
|
1001
|
+
if (!_canTrimWhitespace(tag, attrs) || stackNoTrimWhitespace.length) {
|
|
1002
1002
|
stackNoTrimWhitespace.push(tag);
|
|
1003
1003
|
}
|
|
1004
|
-
if (!_canCollapseWhitespace(tag, attrs)) {
|
|
1004
|
+
if (!_canCollapseWhitespace(tag, attrs) || stackNoCollapseWhitespace.length) {
|
|
1005
1005
|
stackNoCollapseWhitespace.push(tag);
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|