From d75496532192bf296c73a1f9cdf1852ae6a4baba Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 3 Jul 2014 22:19:42 -0700 Subject: [PATCH] 'caseSensitive' option now applies to tags as well as attributes. Closes #198 --- src/htmlminifier.js | 4 ++-- tests/minifier.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/htmlminifier.js b/src/htmlminifier.js index f0c1d9e..5e160d3 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -463,7 +463,7 @@ return; } - tag = tag.toLowerCase(); + tag = options.caseSensitive ? tag : tag.toLowerCase(); currentTag = tag; currentChars = ''; currentAttrs = attrs; @@ -519,7 +519,7 @@ } else { // push end tag to buffer - buffer.push(''); + buffer.push(''); results.push.apply(results, buffer); } // flush buffer diff --git a/tests/minifier.js b/tests/minifier.js index 5704de6..7242e45 100644 --- a/tests/minifier.js +++ b/tests/minifier.js @@ -742,10 +742,10 @@ }); test('caseSensitive', function() { - input = ''; + input = ''; - var caseSensitiveOutput = ''; - var caseInSensitiveOutput = ''; + var caseSensitiveOutput = ''; + var caseInSensitiveOutput = ''; equal(minify(input), caseInSensitiveOutput); equal(minify(input, { caseSensitive: true }), caseSensitiveOutput); -- 2.34.1