<div id="todo">
TODO:
<ul>
- <li>Write more unit tests (~80 so far)</li>
+ <li>Write more unit tests (~90 so far)</li>
<li>Detect repeating attributes (e.g. multiple styles, classes, etc.)</li>
<li>Strip whitespace from attributes where allowed</li>
<li>Report deprecated (or presentational) attributes (e.g.: <code><td width="..." height="..."></code>)</li>
output = '<div>hello<span>world</span></div>';
equals(minify(input, { removeEmptyElements: true }), output);
});
+
+ test('collapsing boolean attributes', function(){
+ input = '<input disabled="disabled">';
+ equals(minify(input, { collapseBooleanAttributes: true }), '<input disabled>');
+
+ input = '<input CHECKED = "checked" readonly="readonly">';
+ equals(minify(input, { collapseBooleanAttributes: true }), '<input checked readonly>');
+
+ input = '<option name="blah" selected="selected">moo</option>';
+ equals(minify(input, { collapseBooleanAttributes: true }), '<option name="blah" selected>moo</option>');
+ });
})(this);
</script>
</body>