HtmlParser class

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

Constructors

HtmlParser(dynamic input, {TreeBuilder? tree, bool strict = false, bool generateSpans = false, String? encoding, bool parseMeta = true, bool lowercaseElementName = true, bool lowercaseAttrName = true, String? sourceUrl})
Create and configure an HtmlParser.

Properties

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

Methods

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 nonexistent method or property is accessed.
inherited
parse() Document
Parse an html5 document into a tree.
parseError(SourceSpan? span, String errorcode, [Map<String, Object?>? datavars = const {}]) → void
parseFragment([String container = 'div']) DocumentFragment
Parse an html5 document fragment into a tree.
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.
inherited

Operators

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