Added a comment to make the reason behind the expression more verbose
authorstieler-it <michael@stieler.it>
Mon, 11 Nov 2013 06:36:48 +0000 (07:36 +0100)
committerstieler-it <michael@stieler.it>
Mon, 11 Nov 2013 06:36:48 +0000 (07:36 +0100)
src/htmlminifier.js

index e5b2c21..3b65b42 100644 (file)
@@ -76,7 +76,9 @@
 
   function canRemoveAttributeQuotes(value) {
     // http://mathiasbynens.be/notes/unquoted-attribute-values
-    return (/^[^\x20\t\n\f\r"'`=<>]+$/).test(value) && !(/\/$/ ).test(value);
+    return (/^[^\x20\t\n\f\r"'`=<>]+$/).test(value) && !(/\/$/ ).test(value) &&
+    // make sure trailing slash is not interpreted as HTML self-closing tag
+        !(/\/$/).test(value);
   }
 
   function attributesInclude(attributes, attribute) {