Skip to content

Loading…

Ensure we reset the parser each time #67

Merged
merged 1 commit into from

2 participants

@mhart

I'm not sure this is the best way to handle it, but this fixes #66

@chriso
Owner

Not sure what's going on here, I'll have to have a look at the htmlparser code to see why the callback gets called multiple time. I'll merge this for now until I can figure out what's going on. Thanks

@chriso chriso merged commit 3894bb8 into chriso:master
@mhart

Yeah, you can't parse multiple times using a handler without a reset in between: https://github.com/tautologistics/node-htmlparser/blob/master/lib/htmlparser.js#L656

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 12, 2011
  1. @mhart
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/node.io/dom.js
View
1 lib/node.io/dom.js
@@ -106,6 +106,7 @@ Job.prototype.prepareHtmlparser = function () {
var self = this, $, htmlparser = require('htmlparser');
this.postParse = function () {};
this.htmlparser = new htmlparser.Parser(new htmlparser.DefaultHandler(function () {
+ self.htmlparser = null;
self.postParse.apply(this, arguments);
}, {verbose: true, ignoreWhitespace: true}
));
Something went wrong with that request. Please try again.