-
-
Notifications
You must be signed in to change notification settings - Fork 396
Parser options
##Usage
var Parser = new htmlparser.Parser(<obj> handler[, <obj> options]);##Events
Names for the keys of the handler object. Only functions are valid values (the parser will break otherwise).
onopentag(<str> name, <obj> attributes)onopentagname(<str> name)onattribute(<str> name, <str> value)ontext(<str> text)onclosetag(<str> name)onprocessinginstruction(<str> name, <str> data)oncomment(<str> data)oncommentend()oncdatastart()oncdataend()onerror(<err> error)onreset()
##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.