Name button "minify" not "convert". Restyle todo list slightly.
authorJuriy Zaytsev <kangax@gmail.com>
Fri, 26 Feb 2010 14:20:38 +0000 (09:20 -0500)
committerJuriy Zaytsev <kangax@gmail.com>
Fri, 26 Feb 2010 14:20:38 +0000 (09:20 -0500)
index.html
master.js
src/htmlminifier.js
tests/index.html

index 8ffff50..1ac56e0 100644 (file)
@@ -21,7 +21,7 @@
           </p>
           <textarea rows="8" cols="40" id="input"></textarea>
           <p style="width:65%">
-            <button type="button" id="convert-btn">Convert</button>
+            <button type="button" id="minify-btn">Minify</button>
           </p>
           <textarea rows="8" cols="40" id="output" readonly></textarea>
         </div>
@@ -30,7 +30,7 @@
             <li>
               <input type="checkbox" id="remove-comments" checked>
               <label for="remove-comments">Remove comments</label>
-              <span class="quiet short" style="margin-left:1.5em">
+              <span class="quiet short" style="margin-left:1.5em;float:left;clear:both;">
                 Conditional comments are left intact.
               </span>
             </li>
                 Remove optional tags
                 <br>
                 <span class="quiet short">
-                  Currently, only <code>&lt;/html></code> and <code>&lt;/body></code>
+                  Currently, only <code>&lt;/html></code>, <code>&lt;/head></code>, and <code>&lt;/body></code>
                 </span>
               </label>
             </li>
         TODO:
         <ul>
           <li>Unit test HTMLLint</li>
-          <li>Detect repeating attributes (e.g. multiple styles, classes, etc.)</li>
           <li>Strip whitespace from attributes where allowed</li>
           <li>Add option to collapse all whitespace to 1 character, instead of completely removing it (to preserve empty text nodes)</li>
           <li>Figure out when it is safe to remove optional closing tags, so that it doesn't affect document tree</li>
           <li>Remove as many empty/blank attributes as possible (not just core ones)</li>
           <li>Parser trips over xml declarations (need to ignore or strip them)</li>
           <li>Generate a report of all applied transformations</li>
-          <li>Warn about missing doctype (as part of linting process)</li>
+        </ul>
+        <ul>
+          <li>HTMLLint: warn about repeating attributes (e.g. multiple styles, classes, etc.)</li>
+          <li>HTMLLint: warn about repeating &amp;nbsp; or &lt;br> sequences</li>
+          <li>HTMLLint: warn about missing doctype</li>
         </ul>
       </div>
       <p class="quiet" style="font-style:italic;">
         HTMLMinifier is made by <a href="http://perfectionkills.com/">kangax</a>, 
         using tweaked version of HTML parser by <a href="http://ejohn.org/">John Resig</a> 
         (which, in its turn, is based on work of <a href="http://erik.eae.net/">Erik Arvidsson</a>).
-        Source is <a href="http://github.com/kangax/html-minifier">hosted on Github</a>.
+        Source and bugtracker is <a href="http://github.com/kangax/html-minifier">hosted on Github</a>.
       </p>
     </div>
     <script src="master.js" type="text/javascript"></script>
index 54bc27f..322deb2 100644 (file)
--- 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,
index e216eb2..fd61c3c 100644 (file)
   }
   
   function isOptionalTag(tag) {
-    return (/^(?:body|html)$/).test(tag);
+    return (/^(?:html|body|head)$/).test(tag);
   }
   
   function canCollapseWhitespace(tag) {
index 90c8f6c..045d3d3 100644 (file)
         });
         
         test('removing optional tags', function(){
-          input = '<html><body><head><title>hello</title></head><p>foo<span>bar</span></p></body></html>';
-          output = '<html><body><head><title>hello</title></head><p>foo<span>bar</span></p>';
+          input = '<html><head><title>hello</title></head><body><p>foo<span>bar</span></p></body></html>';
+          output = '<html><head><title>hello</title><body><p>foo<span>bar</span></p>';
           equals(minify(input, { removeOptionalTags: true }), output);
           equals(minify(input), input);
         });