</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>
<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></html></code> and <code></body></code>
+ Currently, only <code></html></code>, <code></head></code>, and <code></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 &nbsp; or <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>
});
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);
});