I'm writing my own implementation of an HTML parser in JAVA. I have done lexer so far and proceeded to coding parser. I'm creating DOM tree and I would like to determine if my HTML is properly constructed.
E.g., I have a img tag which is a void tag based on w3 org html syntax
and it does not need end tag.
On the other hand, most of the tags like body, head must have its end tag.
My question is: what is the proper way to handle this ?
I don't need a tool or any external site for determing, I'm asking what is the way to determine.
`](https://www.w3.org/TR/html-markup/p.html#p)) have *optional* end tags. Fun, fun!
– Andreas Jan 11 '16 at 21:36