html-minifier 3.5.13 → 3.5.14
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 +8 -8
- package/package.json +1 -1
- package/src/htmlminifier.js +3 -3
package/README.md
CHANGED
|
@@ -23,15 +23,15 @@ How does HTMLMinifier compare to other solutions — [HTML Minifier from Will Pe
|
|
|
23
23
|
| Site | Original size *(KB)* | HTMLMinifier | minimize | Will Peavy | htmlcompressor.com |
|
|
24
24
|
| ---------------------------------------------------------------------------- |:--------------------:| ------------:| --------:| ----------:| ------------------:|
|
|
25
25
|
| [Google](https://www.google.com/) | 45 | **42** | 45 | 46 | 45 |
|
|
26
|
-
| [Twitter](https://twitter.com/) |
|
|
27
|
-
| [HTMLMinifier](https://github.com/kangax/html-minifier) |
|
|
28
|
-
| [New York Times](https://www.nytimes.com/) |
|
|
29
|
-
| [Stack Overflow](https://stackoverflow.com/) |
|
|
26
|
+
| [Twitter](https://twitter.com/) | 122 | **89** | 114 | 132 | 114 |
|
|
27
|
+
| [HTMLMinifier](https://github.com/kangax/html-minifier) | 141 | **110** | 118 | 123 | 118 |
|
|
28
|
+
| [New York Times](https://www.nytimes.com/) | 214 | **147** | 165 | 161 | 150 |
|
|
29
|
+
| [Stack Overflow](https://stackoverflow.com/) | 245 | **192** | 200 | 209 | 198 |
|
|
30
30
|
| [Bootstrap CSS](https://getbootstrap.com/docs/3.3/css/) | 272 | **260** | 269 | 229 | 269 |
|
|
31
|
-
| [BBC](https://www.bbc.co.uk/) |
|
|
32
|
-
| [Amazon](https://www.amazon.co.uk/) |
|
|
33
|
-
| [Wikipedia](https://en.wikipedia.org/wiki/President_of_the_United_States) | 473 | **441** |
|
|
34
|
-
| [NBC](https://www.nbc.com/) |
|
|
31
|
+
| [BBC](https://www.bbc.co.uk/) | 299 | **241** | 291 | 294 | 277 |
|
|
32
|
+
| [Amazon](https://www.amazon.co.uk/) | 369 | **315** | 356 | 367 | n/a |
|
|
33
|
+
| [Wikipedia](https://en.wikipedia.org/wiki/President_of_the_United_States) | 473 | **441** | 458 | 473 | 457 |
|
|
34
|
+
| [NBC](https://www.nbc.com/) | 689 | **648** | 685 | 688 | n/a |
|
|
35
35
|
| [Eloquent Javascript](https://eloquentjavascript.net/1st_edition/print.html) | 870 | **815** | 840 | 864 | n/a |
|
|
36
36
|
| [ES6 table](https://kangax.github.io/compat-table/es6/) | 4808 | **4095** | 4548 | n/a | n/a |
|
|
37
37
|
| [ES6 draft](https://tc39.github.io/ecma262/) | 6099 | **5435** | 5597 | n/a | n/a |
|
package/package.json
CHANGED
package/src/htmlminifier.js
CHANGED
|
@@ -67,9 +67,9 @@ function collapseWhitespace(str, options, trimLeft, trimRight, collapseAll) {
|
|
|
67
67
|
|
|
68
68
|
var createMapFromString = utils.createMapFromString;
|
|
69
69
|
// non-empty tags that will maintain whitespace around them
|
|
70
|
-
var inlineTags = createMapFromString('a,abbr,acronym,b,bdi,bdo,big,button,cite,code,del,dfn,em,font,i,ins,kbd,label,mark,math,nobr,object,q,rt,
|
|
70
|
+
var inlineTags = createMapFromString('a,abbr,acronym,b,bdi,bdo,big,button,cite,code,del,dfn,em,font,i,ins,kbd,label,mark,math,nobr,object,q,rp,rt,rtc,ruby,s,samp,select,small,span,strike,strong,sub,sup,svg,textarea,time,tt,u,var');
|
|
71
71
|
// non-empty tags that will maintain whitespace within them
|
|
72
|
-
var inlineTextTags = createMapFromString('a,abbr,acronym,b,big,del,em,font,i,ins,kbd,mark,nobr,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var');
|
|
72
|
+
var inlineTextTags = createMapFromString('a,abbr,acronym,b,big,del,em,font,i,ins,kbd,mark,nobr,rp,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var');
|
|
73
73
|
// self-closing tags that will maintain whitespace around them
|
|
74
74
|
var selfClosingInlineTags = createMapFromString('comment,img,input,wbr');
|
|
75
75
|
|
|
@@ -395,7 +395,7 @@ var topLevelTags = createMapFromString('html,head,body');
|
|
|
395
395
|
var compactTags = createMapFromString('html,body');
|
|
396
396
|
var looseTags = createMapFromString('head,colgroup,caption');
|
|
397
397
|
var trailingTags = createMapFromString('dt,thead');
|
|
398
|
-
var htmlTags = createMapFromString('a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bdi,bdo,bgsound,big,blink,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,content,data,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,element,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,listing,main,map,mark,marquee,menu,menuitem,meta,meter,multicol,nav,nobr,noembed,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,plaintext,pre,progress,q,rp,rt,rtc,ruby,s,samp,script,section,select,shadow,small,source,spacer,span,strike,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr,xmp');
|
|
398
|
+
var htmlTags = createMapFromString('a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bdi,bdo,bgsound,big,blink,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,content,data,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,element,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,listing,main,map,mark,marquee,menu,menuitem,meta,meter,multicol,nav,nobr,noembed,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,plaintext,pre,progress,q,rb,rp,rt,rtc,ruby,s,samp,script,section,select,shadow,small,source,spacer,span,strike,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr,xmp');
|
|
399
399
|
|
|
400
400
|
function canRemoveParentTag(optionalStartTag, tag) {
|
|
401
401
|
switch (optionalStartTag) {
|