domspace
Adjust the text nodes in an HTML DOM so that the document is pretty-printed when serialized.
Note that the supplied node and its children will be altered. If you'd rather create a copy that's ready for pretty printing, you can deep-clone it first using the DOM API:
const prettyNode = ;
Installation
npm install domspace
Example
const domspace = ;const myDiv = document;myDivinnerHTML = '<span><i>foo</i></span>';;console;
Output:
foo