Note that these changes are dependent on a number of other PRs.
https://github.com/fb55/htmlparser2/pull/76
https://github.com/fb55/DomHandler/pull/9

If those are not accepted then only the else conditional here is useful.