Skip to content
FB55 edited this page Nov 25, 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.

###done Parses the end of the buffer and clears the stack.

###reset Resets buffer & stack, calls onreset.

###parseComplete Resets the parser, parses the data & calls done.

##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.

Clone this wiki locally