Fix parsing of in-text elements

Fixes #863.

Because we didn't save the namespaceURI, parse5 didn't recognize the
<img> tag as self-closing which led to it swallowing the text.

Also fixed the parent-parameter to parse5 since even if we did save the
namespace, it would've still not been provided to parse5 properly.