From: Duncan Beevers Date: Sun, 24 Aug 2014 10:18:58 +0000 (-0500) Subject: collapseBoolean case-sensitivity X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=1117f7aff1823abeef8b79a3b999dba0c508a2b1;p=html-minifier.git collapseBoolean case-sensitivity --- diff --git a/src/htmlminifier.js b/src/htmlminifier.js index 0ec98b5..c680dac 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -155,7 +155,7 @@ } function isBooleanAttribute(attrName) { - return (/^(?:allowfullscreen|async|autofocus|autoplay|checked|compact|controls|declare|default|defaultchecked|defaultmuted|defaultselected|defer|disabled|draggable|enabled|formnovalidate|hidden|indeterminate|inert|ismap|itemscope|loop|multiple|muted|nohref|noresize|noshade|novalidate|nowrap|open|pauseonexit|readonly|required|reversed|scoped|seamless|selected|sortable|spellcheck|truespeed|typemustmatch|visible)$/).test(attrName); + return (/^(?:allowfullscreen|async|autofocus|autoplay|checked|compact|controls|declare|default|defaultchecked|defaultmuted|defaultselected|defer|disabled|draggable|enabled|formnovalidate|hidden|indeterminate|inert|ismap|itemscope|loop|multiple|muted|nohref|noresize|noshade|novalidate|nowrap|open|pauseonexit|readonly|required|reversed|scoped|seamless|selected|sortable|spellcheck|truespeed|typemustmatch|visible)$/i).test(attrName); } function isUriTypeAttribute(attrName, tag) { diff --git a/tests/minifier.js b/tests/minifier.js index 93fa1f6..27d1be4 100644 --- a/tests/minifier.js +++ b/tests/minifier.js @@ -696,6 +696,18 @@ input = ''; equal(minify(input, { collapseBooleanAttributes: true }), ''); + + input = ''; + output = ''; + equal(minify(input, { collapseBooleanAttributes: true, caseSensitive: true }), output); }); test('keeping trailing slashes in tags', function() {