Add </option> to tags allowed for deletion (thanks Jakub Vrána).
--- /dev/null
+[HTMLMinifier](http://kangax.github.com/html-minifier/) is a Javascript-based HTML minifier (duh), with lint-like capabilities.
+
+See [corresponding blog post](http://perfectionkills.com/experimenting-with-html-minifier/) for all the gory details of [how it works](http://perfectionkills.com/experimenting-with-html-minifier/#how_it_works), [description of each option](http://perfectionkills.com/experimenting-with-html-minifier/#options), [testing results](http://perfectionkills.com/experimenting-with-html-minifier/#field_testing) and [conclusions](http://perfectionkills.com/experimenting-with-html-minifier/#cost_and_benefits).
\ No newline at end of file
}
function isOptionalTag(tag) {
- return (/^(?:html|t?body|t?head|tfoot|tr)$/).test(tag);
+ return (/^(?:html|t?body|t?head|tfoot|tr|option)$/).test(tag);
}
var reEmptyAttribute = new RegExp(
buffer.push('>');
},
end: function( tag ) {
-
var isElementEmpty = currentChars === '' && tag === currentTag;
if ((options.removeEmptyElements && isElementEmpty && canRemoveElement(tag))) {
// remove last "element" from buffer, return
}
else if (options.removeOptionalTags && isOptionalTag(tag)) {
// noop, leave start tag in buffer
+ return;
}
else {
// push end tag to buffer
equals(minify(input), input);
});
+ test('removing optional tags in options', function(){
+ input = '<select><option>foo</option><option>bar</option></select>';
+ output = '<select><option>foo<option>bar</select>';
+ equals(minify(input, { removeOptionalTags: true }), output);
+ });
+
})(this);
</script>
</body>