-
-
Notifications
You must be signed in to change notification settings - Fork 394
Parser options
FB55 edited this page Dec 17, 2011
·
26 revisions
##Usage
var Parser = new htmlparser.Parser(handler, options);##Events
- onopentag(name, attributes),
- onclosetag(name),
- ontext(text),
- onprocessinginstruction(name, text),
- oncomment(text)
##Methods
###write (alias: parseChunk)
Parses a chunk of data and calls the corresponding callbacks.
###end (alias: done)
Parses the end of the buffer and clears the stack, calls onend.
###reset
Resets buffer & stack, calls onreset.
###parseComplete
Resets the parser, parses the data & calls end.
##Option: xmlMode
Indicates whether <script> and <style> tags should get special treatment. If false, their content will be text only. For RSS feeds and other XML content (not HTML), set this to true. Default: false.
##Option: lowerCaseTags If set to true, all tags will be lowercased. This has noticeable impact on speed, so it defaults to false.