From: Juriy Zaytsev Date: Fri, 26 Feb 2010 14:20:38 +0000 (-0500) Subject: Name button "minify" not "convert". Restyle todo list slightly. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=72dc73bf5f8f921c0e9cd4b561243d0bd1145b15;p=html-minifier.git Name button "minify" not "convert". Restyle todo list slightly. --- diff --git a/index.html b/index.html index 8ffff50..1ac56e0 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@

- +

@@ -30,7 +30,7 @@
  • - + Conditional comments are left intact.
  • @@ -100,7 +100,7 @@ Remove optional tags
    - Currently, only </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 = 'hello

    foobar

    '; - output = 'hello

    foobar

    '; + input = 'hello

    foobar

    '; + output = 'hello

    foobar

    '; equals(minify(input, { removeOptionalTags: true }), output); equals(minify(input), input); });