From: sndrs Date: Thu, 13 Jun 2013 15:06:23 +0000 (+0100) Subject: jshint wanted the parens to continue past linting X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=f9d7df290417a9f0a902c1cac4ceb3b850383eea;p=html-minifier.git jshint wanted the parens to continue past linting --- diff --git a/dist/all.js b/dist/all.js index aa7f3ad..a85e1db 100644 --- a/dist/all.js +++ b/dist/all.js @@ -413,9 +413,8 @@ } 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) { diff --git a/src/htmlminifier.js b/src/htmlminifier.js index 4df4c22..eb01502 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -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) {