<label for="collapse-boolean-attributes">
Collapse boolean attributes
<br>
- <span class="quiet">
- (e.g. <code><input disabled="disabled"> → <input disabled></code>)
+ <span class="quiet short">
+ (e.g. <code><... disabled="disabled"> → <... disabled></code>)
</span>
</label>
</li>
</li>
<li>
<input type="checkbox" id="use-short-doctype" checked>
- <label for="use-short-doctype">
+ <label for="use-short-doctype" title="i.e. <!DOCTYPE html>">
Use short doctype
- <br>
- <code class="quiet"><!DOCTYPE html></code>
</label>
</li>
<li>
<label for="remove-empty-attributes">
Remove empty (or blank) attributes
<br>
- <code class="quiet">Valid combinations are: class, id, style, title, lang, dir, event attributes</code>
+ <span class="quiet short">
+ Valid attributes are: class, id, style, title, lang, dir, event attributes
+ </span>
</label>
</li>
</ul>
<ul>
<li>Write unit tests for minifier (!)</li>
<li>Detect empty elements (not just attributes)</li>
+ <li>Detect repeating attributes (e.g. multiple styles)</li>
<li>Report deprecated (or presentational) attributes (e.g.: <code><td width="..." height="..."></code>)</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>Do not strip IE conditional comments</li>
<li>Remove as many empty/blank attributes as possible (not just core ones)</li>
+ <li>Add option to remove comments/CDATA sections from scripts/styles</li>
<li>Parser trips over xml declarations (need to ignore or strip them)</li>
<li>Generate a report of all applied transformations</li>
</ul>
.success { color: green; }
.failure { color: red; }
-.quiet { font-size: 0.85em; color: #888; }
\ No newline at end of file
+.quiet { font-size: 0.85em; color: #888; }
+.short { display: inline-block; width: 20em; margin-top: 0.25em; }
\ No newline at end of file
});
test('empty attributes', function(){
- var input = '<p id="" class="" style=" " title="\n" lang="" dir="">x</p>';
+ var input = '<p id="" class="" STYLE=" " title="\n" lang="" dir="">x</p>';
equals(minify(input, { shouldRemoveEmptyAttributes: true }), '<p>x</p>');
- input = '<p onclick="" ondblclick=" " onmousedown="" onmouseup="" onmouseover=" " onmousemove="" onmouseout="" '+
+ input = '<p onclick="" ondblclick=" " onmousedown="" ONMOUSEUP="" onmouseover=" " onmousemove="" onmouseout="" '+
'onkeypress=\n\n "\n " onkeydown=\n"" onkeyup\n="">x</p>';
equals(minify(input, { shouldRemoveEmptyAttributes: true }), '<p>x</p>');