Proper parser
Currently only 'paragraph' is parsed correctly for closing. If one refers to https://html.spec.whatwg.org/ though, when a tag closes is defined but rather complicated. This begs for its own library but would be a massive improvement over the reliability of this library and be a good factoring of concerns.
The point of this browser would be something along the lines of "parse HTML like a browser does" and a decent portion of it should be autogeneratable from said specification. This would fairly include the line ending conversions potentially.