Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ fields.feed = [
['dc:source', 'source'],
['dc:title', 'title'],
['dc:type', 'type'],
'title',
'description',

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing 'title' from fields.feed drops feed-level title parsing for all RSS/RDF feeds.

buildRSS() populates feed fields solely through utils.copyFromXML(channel, feed, feedFields) (lib/parser.js:227), so without this entry <channel><title> is never copied to feed.title. The surviving ['dc:title', 'title'] above reads a different element (dc:title) and does not cover feeds that use a plain <title> — e.g. test/input/reddit.rss.

Atom feeds still work because parseAtomFeed() assigns feed.title directly (lib/parser.js:143-147), which makes this failure silent and asymmetric across formats. 23 RSS/RDF golden files in test/output/ assert a feed-level title and will fail.

Please restore this entry.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing 'title' from fields.feed drops feed-level title parsing for all RSS/RDF feeds.

feed.title for RSS 0.9x/2.0 and RDF is set exclusively by utils.copyFromXML(channel, feed, feedFields) (lib/parser.js:227), and copyFromXML only copies fields that are listed (lib/utils.js:47). The only remaining mapping to title is ['dc:title', 'title'] on line 8, which requires the channel to carry a dc:title element. Most RSS feeds don't, so feed.title will be undefined.

Concretely: test/input/guardian.rss has no dc:title, but test/output/guardian.json expects feed.title === "The Guardian". 27 of 29 fixtures in test/output/ assert a top-level feed.title.

There's a second, subtler effect: 'title' used to be listed after ['dc:title', 'title'], so for feeds that have both, the plain <title> overwrote dc:title. With the plain entry gone, dc:title now wins — those feeds silently get a different title instead of none.

Please restore 'title' in its original position to preserve both behavior and precedence. Atom feeds are unaffected (handled separately at lib/parser.js:143-146).

'author',
'pubDate',
Expand Down
Loading