From d6db21012e684afb159495b2659fc5bbb7a0f1e0 Mon Sep 17 00:00:00 2001 From: Juriy Zaytsev Date: Fri, 26 Feb 2010 09:25:32 -0500 Subject: [PATCH] Add "thead", "tbody" and "tfoot" end tags to "allowed for removal" list. --- src/htmlminifier.js | 2 +- tests/index.html | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/htmlminifier.js b/src/htmlminifier.js index fd61c3c..2276f80 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -121,7 +121,7 @@ } function isOptionalTag(tag) { - return (/^(?:html|body|head)$/).test(tag); + return (/^(?:html|t?body|t?head|tfoot)$/).test(tag); } function canCollapseWhitespace(tag) { diff --git a/tests/index.html b/tests/index.html index 045d3d3..ed95793 100644 --- a/tests/index.html +++ b/tests/index.html @@ -337,6 +337,11 @@ output = 'hello

foobar

'; equals(minify(input, { removeOptionalTags: true }), output); equals(minify(input), input); + + input = '
'; + output = '
'; + equals(minify(input, { removeOptionalTags: true }), output); + equals(minify(input), input); }); })(this); -- 2.34.1