From: Thomas Genin Date: Wed, 11 Nov 2015 22:50:01 +0000 (-0800) Subject: Restore SVG into the common tag X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=9f550e1da2bc181037e7aa9ba741853be4393edd;p=html-minifier.git Restore SVG into the common tag --- diff --git a/src/htmlminifier.js b/src/htmlminifier.js index a9c330a..05985eb 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -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 ]*$/, @@ -586,7 +586,7 @@ log(err); } - return text; + return text.trim(); } function minify(value, options) { diff --git a/src/htmlparser.js b/src/htmlparser.js index 3f42e1e..aa51208 100644 --- a/src/htmlparser.js +++ b/src/htmlparser.js @@ -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)