dom_parsing library

This library contains extra APIs that aren't in the DOM, but are useful when interacting with the parse tree.

Classes

CodeMarkupVisitor
Converts the DOM tree into an HTML string with code markup suitable for displaying the HTML's source code with CSS colors for different parts of the markup. See also htmlToCodeMarkup.
TreeVisitor
A simple tree visitor for the DOM nodes.

Functions

htmlSerializeEscape(String text, {bool attributeMode = false}) String
Escapes text for use in the HTML fragment serialization algorithm. In particular, as described in the specification:
htmlToCodeMarkup(Node node) String
Converts the DOM tree into an HTML string with code markup suitable for displaying the HTML's source code with CSS colors for different parts of the markup. See also CodeMarkupVisitor.
isVoidElement(String? tagName) bool
Returns true if this tag name is a void element. This method is useful to a pretty printer, because void elements must not have an end tag. See also: dev.w3.org/html5/markup/syntax.html#void-elements.
writeTextNodeAsHtml(StringBuffer str, Text node) → void
Serialize text node according to: www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#html-fragment-serialization-algorithm