new DomHandler(stream)
Dom handler for htmlparser2
Parameters:
Name | Type | Description |
---|---|---|
stream |
Stream | The parser stream |
- Source:
Members
-
_done :Boolean
-
Type:
- Boolean
- Source:
-
_parser :HtmlParser
-
Type:
- HtmlParser
- Source:
-
_stream :Stream
-
Type:
- Stream
- Source:
-
_tagStack :Array.<MCTag>
-
Type:
- Array.<MCTag>
- Source:
-
ast :Array.<MCNode>
-
Type:
- Array.<MCNode>
- Source:
Methods
-
_addNode(node)
-
Adds a node to the AST
Parameters:
Name Type Description node
Node The node to add
- Source:
-
onclosetag()
-
Handles finding a close tag
- Source:
-
onend()
-
Html parser is complete
- Source:
-
onerror(err)
-
Throws an error
Parameters:
Name Type Description err
Error The error
- Source:
-
onopenttag(name, attribs)
-
Handles finding an open tag
Parameters:
Name Type Description name
string The tag name
attribs
Object.<string, string> An object of attributes
- Source:
-
onparserinit(parser)
-
Dom handler initializer
Parameters:
Name Type Description parser
htmlparser2.Parser The current instance of the htmlparser
- Source:
-
onreset()
-
Resets the Dom handler to it's initial state
- Source: