> HTML in the wild is not quite as bad as it was and is much more easily parseable as well
I beg to differ with the "HTML in the wild" concept and need for heuristics. HTML, including HTML5, was and is easily parseable using SGML, the markup meta-language on which HTML versions up to HTML 4 were specified. My DTD for HTML 5 (W3C's current HTML 5.2) can parse up to 97.31% of the test suite normatively referenced by the HTML spec (the rest being somewhat in a grey area containing constructs to make test automation happy, which is designed to never fail, but rather to produce something still in a predictable way) [1].
[1]: http://sgmljs.net/docs/sgml-html-tutorial.html (reported on the slides reached via the "TALK" link)