Renders into a string to be consumed by browsers. The input's structure is respected as much as possible:
No whitespace is added or removed.
Tag names are not escaped.
The output uses HTML5 syntax. It is not compatible with XML syntax for HTML.
Details of the output syntax #
We make the following XML-compatible choices:
Void elements with
isEmptychildren are rendered as self-closing tags.- Void elements with non-
isEmptychildren are rendered like normal elements. Such elements are forbidden by the HTML spec.
- Void elements with non-
Attribute values are always double-quoted.
And the following incompatible choices:
- Attributes with empty values are minimized.