From: stieler-it Date: Tue, 22 Oct 2013 09:56:53 +0000 (+0200) Subject: Preserve quotes if attribute ends with a trailing slash X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=ea27fd1d03328d70705a5b3f9c2d5e5f84898812;p=html-minifier.git Preserve quotes if attribute ends with a trailing slash minified URLs in parameters, like need to keept their quotes because is interpreted as an URL without trailing slash --- diff --git a/src/htmlminifier.js b/src/htmlminifier.js index d07f221..e5b2c21 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -76,7 +76,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) && !(/\/$/ ).test(value); } function attributesInclude(attributes, attribute) {