Skip to content

Conversation

@rbren
Copy link
Owner

@rbren rbren commented Jan 14, 2026

Summary

This PR adds the subtitle field to the list of feed fields, allowing the parser to extract the <subtitle> element from RSS/Atom feeds.

Changes

  • lib/fields.js: Added 'subtitle' to the fields.feed array
  • index.d.ts: Added subtitle?: string to the TypeScript Output interface for proper type support

Testing

All existing tests pass (38 passing).

@rbren can click here to continue refining the PR

- Added 'subtitle' to the feed fields array in lib/fields.js
- Added 'subtitle?: string' to the Output interface in index.d.ts

This allows the parser to extract the <subtitle> element from RSS/Atom feeds.

Co-authored-by: openhands <[email protected]>
@rbren
Copy link
Owner Author

rbren commented Jan 14, 2026

@OpenHands add tests for the new subtitle field

@openhands-ai
Copy link

openhands-ai bot commented Jan 14, 2026

I'm on it! rbren can track my progress at all-hands.dev

- Add support for parsing subtitle from Atom feeds in buildAtomFeed()
- Add dedicated test files for subtitle parsing (RSS and Atom)
- Update existing test output files to include subtitle field
- Add two new test cases: 'should parse subtitle from RSS feed' and 'should parse subtitle from Atom feed'

Co-authored-by: openhands <[email protected]>
@openhands-ai
Copy link

openhands-ai bot commented Jan 14, 2026

I've successfully added tests for the new subtitle field. Here's a summary of the changes:

Changes Made

1. Added Atom feed subtitle parsing support (lib/parser.js)

  • Extended buildAtomFeed() method to extract the <subtitle> element from Atom feeds
  • The RSS feed subtitle parsing was already working via the fields.feed array

2. Added dedicated test files

  • test/input/subtitle.rss - RSS feed test input with subtitle
  • test/input/subtitle-atom.atom - Atom feed test input with subtitle
  • test/output/subtitle.json - Expected output for RSS subtitle test
  • test/output/subtitle-atom.json - Expected output for Atom subtitle test

3. Added test cases (test/parser.js)

  • 'should parse subtitle from RSS feed' - Tests RSS 2.0 subtitle parsing
  • 'should parse subtitle from Atom feed' - Tests Atom subtitle parsing

4. Updated existing test output files

  • test/output/feedburner.json - Added subtitle field
  • test/output/heise.json - Added subtitle field
  • test/output/many-links.json - Added subtitle field

These existing Atom feeds already contained <subtitle> elements, so the expected outputs needed to be updated to include the newly parsed subtitle field.

Test Results

All 40 tests pass (38 existing + 2 new subtitle tests).

The changes have been pushed to the add-subtitle-to-feed-fields branch to update PR #296.

View full conversation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants