The HTML5 Validator is okay with self-closing tags on void elements (e.g. <br/>), but not on normal elements (e.g. <p/>). In fact, it's almost definitely going to result in wonky code when used on non-void elements, because many browsers interpret it as an opening tag instead of an opening tag immediately followed by a closing tag--I once spent hours debugging a <script src="blah.js"/> only to find out that the script was never being loaded, because I self-closed the tag instead of providing a </script>.
So, I think we should do what the HTML5 validator does and accept self-closing tags on void elements, but not on non-void elements. We could potentially provide a helpful error when we run into self-closed non-void elements, though.
Parsing of self-closing tags for void elements now works. Added SELF_…
…CLOSING_NON_VOID_ELEMENT error for the other tags. This fixes #23.