From: Juriy Zaytsev
- +
@@ -30,7 +30,7 @@</html>
and </body>
+ Currently, only </html>
, </head>
, and </body>
@@ -132,7 +132,6 @@
TODO:
HTMLMinifier is made by kangax, using tweaked version of HTML parser by John Resig (which, in its turn, is based on work of Erik Arvidsson). - Source is hosted on Github. + Source and bugtracker is hosted on Github.
diff --git a/master.js b/master.js index 54bc27f..322deb2 100644 --- a/master.js +++ b/master.js @@ -32,7 +32,7 @@ .split('').reverse().join(''); } - byId('convert-btn').onclick = function() { + byId('minify-btn').onclick = function() { try { var options = getOptions(), lint = options.lint, diff --git a/src/htmlminifier.js b/src/htmlminifier.js index e216eb2..fd61c3c 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -121,7 +121,7 @@ } function isOptionalTag(tag) { - return (/^(?:body|html)$/).test(tag); + return (/^(?:html|body|head)$/).test(tag); } function canCollapseWhitespace(tag) { diff --git a/tests/index.html b/tests/index.html index 90c8f6c..045d3d3 100644 --- a/tests/index.html +++ b/tests/index.html @@ -333,8 +333,8 @@ }); test('removing optional tags', function(){ - input = 'foobar
'; - output = 'foobar
'; + input = 'foobar
'; + output = 'foobar
'; equals(minify(input, { removeOptionalTags: true }), output); equals(minify(input), input); });