Skip to content

v8.0.4

Latest

Choose a tag to compare

@ndaidong ndaidong released this 15 Nov 05:02
b2dc1d5

Fixes two Atom feed correctness issues per RFC 4287, reported in #157.

Changed

  • Atom <link> selection — feed.link and entry.link now prefer the <link> with rel="alternate" (or no rel attribute) instead of always taking the first <link>. Links such as rel="self", rel="enclosure", rel="related" and rel="edit" are skipped; if a feed has no alternate link, the first link is still used as a fallback.
  • Atom entry published — now resolves from <published> → <issued> → <updated> → <modified> (first one available), instead of preferring <updated>. Since <updated> is mandatory in Atom 1.0, entry.published previously always reported the last modification time.

Breaking-ish behavioral changes (no API change)

Output values change for Atom feeds that contain multiple <link> elements or both <published> and <updated>:

// before (#157)
{ "feedLink": "https://example.org/feed.atom", "link": "https://example.org/ep1.mp3", "published": "2026-01-01T00:00:00.000Z" }
// after
{ "feedLink": "https://example.org/", "link": "https://example.org/posts/ep1", "published": "2023-11-09T17:23:02.000Z" }
  • feed.link now returns the site URL instead of the feed's rel="self" URL (affects most Atom feeds, incl. Google News).
  • entry.link no longer returns enclosure/related URLs when an alternate link exists.
  • entry.published now returns the initial publication time, not the last update.

Feed-level published still uses <updated> (Atom feeds have no <published> element). RSS, RDF and JSON Feed behavior is unchanged.

Docs

  • README now documents how link and published are resolved for Atom feeds.

Full diff: v8.0.3...v8.0.4
Closes #157