Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Giving bad URL causes bad behavior #25

Closed
rogovdm opened this Issue · 1 comment

2 participants

@rogovdm

with query = "http://lifehacker.com/"

var parser = new FeedParser().parseUrl(query, function (err, meta, art) {
//...
});

we have:

TypeError: Cannot call method 'trim' of undefined
at /usr/home//data/www/**/node_modules/feedparser/main.js:101:60

@danmactough
Owner

Thanks for the report. That was actually just a plain ol' bug.

Note that because feedparser uses sax, and sax aspires to be a streaming HTML parser, an HTML document won't cause a parser error -- you just won't get any meta or articles.

Beginning with v0.10.1 (which contains the bug fix), you can pass {strict: true} to the feedparser constructor to turn on sax's strict mode, which will result in a parser error on HTML (but not on XHTML, I don't think).

@danmactough danmactough closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.