From 1117f7aff1823abeef8b79a3b999dba0c508a2b1 Mon Sep 17 00:00:00 2001 From: Duncan Beevers Date: Sun, 24 Aug 2014 05:18:58 -0500 Subject: [PATCH] collapseBoolean case-sensitivity --- src/htmlminifier.js | 2 +- tests/minifier.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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() { -- 2.34.1