Document.toPrettyString
string toPrettyString() constThe document as indented html, to read it: each block element on its own line, two spaces for each level; elements with only text and inline elements stay on one line. The whitespace between the nodes changes (except in <pre>, <textarea>, <script>, ...): use toString to store or send the html.
Document doc = `<ul><li>Bread</li><li>Milk <b>2 l</b></li></ul>`;
assert(doc.toPrettyString ==
"<html>\n" ~
" <head></head>\n" ~
" <body>\n" ~
" <ul>\n" ~
" <li>Bread</li>\n" ~
" <li>Milk <b>2 l</b></li>\n" ~
" </ul>\n" ~
" </body>\n" ~
"</html>");