jshint wanted the parens to continue past linting
authorsndrs <sndrs@me.com>
Thu, 13 Jun 2013 15:06:23 +0000 (16:06 +0100)
committersndrs <sndrs@me.com>
Thu, 13 Jun 2013 15:06:23 +0000 (16:06 +0100)
dist/all.js
src/htmlminifier.js

index aa7f3ad..a85e1db 100644 (file)
   }
 
   function canRemoveAttributeQuotes(value) {
-    // http://www.w3.org/TR/html4/intro/sgmltut.html#attributes
-    // avoid \w, which could match unicode in some implementations
-    return (/^[a-zA-Z0-9-._:]+$/).test(value);
+    // http://mathiasbynens.be/notes/unquoted-attribute-values
+    return (/^[^\x20\t\n\f\r"'`=<>]+$/).test(value);
   }
 
   function attributesInclude(attributes, attribute) {
index 4df4c22..eb01502 100644 (file)
@@ -72,7 +72,7 @@
 
   function canRemoveAttributeQuotes(value) {
     // http://mathiasbynens.be/notes/unquoted-attribute-values
-    return /^[^\x20\t\n\f\r"'`=<>]+$/.test(value);
+    return (/^[^\x20\t\n\f\r"'`=<>]+$/).test(value);
   }
 
   function attributesInclude(attributes, attribute) {