Issue #12 was apparently caused by HTML documents being serialized back after processing without their DOCTYPE declaration and root element, causing the browser not to render them as intended sometimes.
While fixing this, we noticed that other bugs were waiting to happen due to a problematic Promise resolution pattern in edit_html().
We renamed the function to editHtml() and converted it to idiomatic asynchronous EcmaScript, which made the return values explicit and all the flow much more readable and easy to maintain.
Issue #12 was apparently caused by HTML documents being serialized back after processing without their DOCTYPE declaration and root element, causing the browser not to render them as intended sometimes.
While fixing this, we noticed that other bugs were waiting to happen due to a problematic Promise resolution pattern in edit_html().
We renamed the function to editHtml() and converted it to idiomatic asynchronous EcmaScript, which made the return values explicit and all the flow much more readable and easy to maintain.