HtmlParser class Null safety

Parser for HTML, which generates a tree structure from a stream of (possibly malformed) characters.


HtmlParser(dynamic input, {String? encoding, bool parseMeta = true, bool lowercaseElementName = true, bool lowercaseAttrName = true, bool strict = false, bool generateSpans = false, String? sourceUrl, TreeBuilder? tree})
Create an HtmlParser and configure the tree builder and strict mode. The input can be a String, List<int> of bytes or an HtmlTokenizer.


compatMode String
"quirks" / "limited quirks" / "no quirks"
read / write
errors List<ParseError>
firstStartTag bool
read / write
framesetOK bool
read / write
generateSpans bool
True to generate SourceSpans for the Node.sourceSpan property.
hashCode int
The hash code for this object.
read-only, inherited
innerHTML String?
innerHTML container when parsing document fragment.
read / write
innerHTMLMode bool
originalPhase Phase?
read / write
phase Phase
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
strict bool
Raise an exception on the first error encountered.
tokenizer → HtmlTokenizer
tree → TreeBuilder


adjustForeignAttributes(StartTagToken token) → void
adjustMathMLAttributes(StartTagToken token) → void
adjustSVGAttributes(StartTagToken token) → void
inForeignContent(Token token, int type) bool
isHTMLIntegrationPoint(Element element) bool
isMathMLTextIntegrationPoint(Element element) bool
mainLoop() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
parse() Document
Parse an html5 document into a tree. After parsing, errors will be populated with parse errors, if any.
parseError(SourceSpan? span, String errorcode, [Map? datavars = const {}]) → void
parseFragment([String container = 'div']) DocumentFragment
Parse an html5 document fragment into a tree. Pass a container to change the type of the containing element. After parsing, errors will be populated with parse errors, if any.
parseRCDataRawtext(Token token, String contentType) → void
Generic RCDATA/RAWTEXT Parsing algorithm contentType - RCDATA or RAWTEXT
reset() → void
resetInsertionMode() → void
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.