Document.fragment

Node fragment(const(char)[] html, const(char)[] context = "body")

Parse a fragment of html. The result is a DocumentFragment node, not attached to the document: inserting it (append, before, ...) moves its children.

context is the element where the html is meant to go, as in the standard fragment parsing: the default is body. With "tr" the html <td>x gives a cell, with "textarea" everything is text, with "template" the content of a template, ... Use "svg" or "math" for foreign content.