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 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/) | 44 | **42** | 45 | 46 | 45 |
26
- | [HTMLMinifier](https://github.com/kangax/html-minifier) | 127 | **100** | 108 | 112 | 107 |
27
- | [CNN](http://www.cnn.com/) | 136 | **125** | 133 | 134 | 129 |
28
- | [Amazon](http://www.amazon.co.uk/) | 196 | **165** | 188 | 192 | n/a |
29
- | [Stack Overflow](http://stackoverflow.com/) | 223 | **172** | 181 | 188 | 178 |
30
- | [New York Times](http://www.nytimes.com/) | 224 | **153** | 172 | 170 | 159 |
31
- | [BBC](http://www.bbc.co.uk/) | 236 | **194** | 229 | 236 | 223 |
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 | **503** | 530 | 548 | 529 |
34
- | [NBC](http://www.nbc.com/) | 643 | **612** | 641 | 643 | n/a |
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "html-minifier",
3
3
  "description": "Highly configurable, well-tested, JavaScript-based HTML minifier.",
4
- "version": "3.5.1",
4
+ "version": "3.5.2",
5
5
  "keywords": [
6
6
  "cli",
7
7
  "compress",
@@ -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
  }