Restore SVG into the common tag
authorThomas Genin <tgenin@expensify.com>
Wed, 11 Nov 2015 22:50:01 +0000 (14:50 -0800)
committerThomas Genin <tgenin@expensify.com>
Wed, 11 Nov 2015 22:50:01 +0000 (14:50 -0800)
src/htmlminifier.js
src/htmlparser.js

index a9c330a..05985eb 100644 (file)
@@ -47,7 +47,7 @@
       'a', 'abbr', 'acronym', 'b', 'bdi', 'bdo', 'big', 'button', 'cite',
       'code', 'del', 'dfn', 'em', 'font', 'i', 'ins', 'kbd', 'mark', 'q',
       'rt', 'rp', 's', 'samp', 'small', 'span', 'strike', 'strong',
-      'sub', 'sup', 'time', 'tt', 'u', 'var'
+      'sub', 'sup', 'svg', 'time', 'tt', 'u', 'var'
     ],
     lineBreakBefore = /^[\t ]*[\n\r]+[\t\n\r ]*/,
     lineBreakAfter = /[\t\n\r ]*[\n\r]+[\t ]*$/,
       log(err);
     }
 
-    return text;
+    return text.trim();
   }
 
   function minify(value, options) {
index 3f42e1e..aa51208 100644 (file)
@@ -58,7 +58,7 @@
   // var block = makeMap('address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul');
 
   // Inline Elements - HTML 4.01
-  var inline = makeMap('a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,noscript,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var');
+  var inline = makeMap('a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,noscript,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,svg,textarea,tt,u,var');
 
   // Elements that you can, intentionally, leave open
   // (and which close themselves)