add code, kbd and quote to tags with space around them
authorAlex Sanders <sndrs@me.com>
Thu, 13 Jun 2013 12:35:49 +0000 (14:35 +0200)
committerAlex Sanders <sndrs@me.com>
Thu, 13 Jun 2013 12:35:49 +0000 (14:35 +0200)
these tags get cinched up currently, e.g. <p>here's some<code>code</code></p> and <p>I said<q>yes!<q>and left.<p>

src/htmlminifier.js

index eafb599..4df4c22 100644 (file)
@@ -42,7 +42,7 @@
 
   function collapseWhitespaceSmart(str, prevTag, nextTag) {
     // array of tags that will maintain a single space outside of them
-    var tags = ['a', 'b', 'big', 'button', 'em', 'font','i',  'img', 'mark', 's', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'tt', 'u'];
+    var tags = ['a', 'b', 'big', 'button', 'code', 'em', 'font','i',  'img', 'kbd', 'mark', 'q', 's', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'tt', 'u'];
 
     if (prevTag && (prevTag.substr(0,1) !== '/'
       || ( prevTag.substr(0,1) === '/' && tags.indexOf(prevTag.substr(1)) === -1))) {