Repository navigation
Fixes two Atom feed correctness issues per RFC 4287, reported in #157.
Changed
- Atom
<link>selection —feed.linkandentry.linknow prefer the<link>withrel="alternate"(or norelattribute) instead of always taking the first<link>. Links such asrel="self",rel="enclosure",rel="related"andrel="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.publishedpreviously 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.linknow returns the site URL instead of the feed'srel="self"URL (affects most Atom feeds, incl. Google News).entry.linkno longer returns enclosure/related URLs when an alternate link exists.entry.publishednow 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
linkandpublishedare resolved for Atom feeds.
Full diff: v8.0.3...v8.0.4
Closes #157