danmactough / node-feedparser

Robust RSS, Atom, and RDF feed parsing in Node.js
Other
1.97k stars 192 forks source link

Missing base URL when parsing Github release atom feeds #168

Closed francishart closed 6 years ago

francishart commented 8 years ago

There seems to be a bug when parsing a Github release feed (example: https://github.com/danmactough/node-feedparser/releases.atom), the first entry is missing the base URL however all other entries looks fine.

First entry:

{
    "title": "v1.1.3",
    "description": "<p>Bump version: v1.1.3</p>",
    "summary": null,
    "date": "2015-06-12T04:08:25.000Z",
    "pubdate": "2015-06-12T04:08:25.000Z",
    "pubDate": "2015-06-12T04:08:25.000Z",
    "link": "/danmactough/node-feedparser/releases/tag/v1.1.3",
    "guid": "tag:github.com,2008:Repository/2392967/v1.1.3",
    "author": "danmactough",
    "comments": null,
   ...

Second entry:

{
    "title": "v1.1.2",
    "description": "<p>Bump version: v1.1.2</p>",
    "summary": null,
    "date": "2015-06-02T22:38:23.000Z",
    "pubdate": "2015-06-02T22:38:23.000Z",
    "pubDate": "2015-06-02T22:38:23.000Z",
    "link": "https://github.com/danmactough/node-feedparser/releases/tag/v1.1.2",
    "guid": "tag:github.com,2008:Repository/2392967/v1.1.2",
    "author": "danmactough",
    "comments": null,
    ...

Tested with the iconv example code, feedparser 1.1.4.

liptonista commented 6 years ago

Same here. But this can be avoided by adding feedurl option to new FeedParser as written in README.

I think one of the reasons of the missing base URL is that reresolve method does not handle nodes recursively.

danmactough commented 6 years ago

fixed via 6cf0cf7 and published in v2.2.4