b-fuze / deno-dom

Browser DOM & HTML parser in Deno
https://jsr.io/@b-fuze/deno-dom
MIT License
423 stars 47 forks source link

Support for stringify #142

Closed vwkd closed 1 year ago

vwkd commented 1 year ago

Please add support to stringify a parsed DOM back into HTML.

This is useful to manipulate or rewrite HTML.

b-fuze commented 1 year ago

To serialize the document to a string you can use the .outerHTML property:

const htmlString = "<!DOCTYPE html>\n" + doc.documentElement.outerHTML;
vwkd commented 1 year ago

Too easy, missed that. Sorry!