From c3b82f9751c7a2ebb129310fda4cb51d726e4590 Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 5 Feb 2026 16:07:51 +0000 Subject: [PATCH 1/2] Add subtitle field to feed and item field lists Co-authored-by: openhands --- lib/fields.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/fields.js b/lib/fields.js index b3f8d7b..964dce4 100644 --- a/lib/fields.js +++ b/lib/fields.js @@ -9,6 +9,7 @@ fields.feed = [ ['dc:type', 'type'], 'title', 'description', + 'subtitle', 'author', 'pubDate', 'webMaster', @@ -35,6 +36,7 @@ fields.item = [ ['dc:source', 'source'], ['dc:title', 'title'], 'title', + 'subtitle', 'link', 'pubDate', 'author', From 0cbbc996cf09144775e5a39630aaf1b0736cee2e Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 5 Feb 2026 16:11:30 +0000 Subject: [PATCH 2/2] Add test for subtitle field parsing in feed and items - Add test input file (subtitle.rss) with subtitle fields at both feed and item levels - Add expected output file (subtitle.json) with parsed subtitle values - Add test case in parser.js to verify subtitle field parsing --- test/input/subtitle.rss | 27 +++++++++++++++++++++++++++ test/output/subtitle.json | 32 ++++++++++++++++++++++++++++++++ test/parser.js | 4 ++++ 3 files changed, 63 insertions(+) create mode 100644 test/input/subtitle.rss create mode 100644 test/output/subtitle.json diff --git a/test/input/subtitle.rss b/test/input/subtitle.rss new file mode 100644 index 0000000..07ddd6d --- /dev/null +++ b/test/input/subtitle.rss @@ -0,0 +1,27 @@ + + + + Example Blog + https://example.com/blog + A blog about technology and programming + Tech insights and tutorials + en-us + Mon, 15 Jan 2024 10:00:00 GMT + + First Post + An introduction to our blog + https://example.com/blog/post-1 + Welcome to our blog! + Mon, 15 Jan 2024 10:00:00 GMT + https://example.com/blog/post-1 + + + Second Post + More content for readers + https://example.com/blog/post-2 + Here is another post. + Sun, 14 Jan 2024 09:00:00 GMT + https://example.com/blog/post-2 + + + diff --git a/test/output/subtitle.json b/test/output/subtitle.json new file mode 100644 index 0000000..01aec06 --- /dev/null +++ b/test/output/subtitle.json @@ -0,0 +1,32 @@ +{ + "feed": { + "items": [ + { + "title": "First Post", + "subtitle": "An introduction to our blog", + "link": "https://example.com/blog/post-1", + "pubDate": "Mon, 15 Jan 2024 10:00:00 GMT", + "content": "Welcome to our blog!", + "contentSnippet": "Welcome to our blog!", + "guid": "https://example.com/blog/post-1", + "isoDate": "2024-01-15T10:00:00.000Z" + }, + { + "title": "Second Post", + "subtitle": "More content for readers", + "link": "https://example.com/blog/post-2", + "pubDate": "Sun, 14 Jan 2024 09:00:00 GMT", + "content": "Here is another post.", + "contentSnippet": "Here is another post.", + "guid": "https://example.com/blog/post-2", + "isoDate": "2024-01-14T09:00:00.000Z" + } + ], + "title": "Example Blog", + "description": "A blog about technology and programming", + "subtitle": "Tech insights and tutorials", + "link": "https://example.com/blog", + "language": "en-us", + "lastBuildDate": "Mon, 15 Jan 2024 10:00:00 GMT" + } +} diff --git a/test/parser.js b/test/parser.js index 034c72f..fd7b06a 100644 --- a/test/parser.js +++ b/test/parser.js @@ -284,4 +284,8 @@ describe('Parser', function() { it('should parse atom:link pagination links', function (done) { testParseForFile('pagination-links', 'rss', done); }); + + it('should parse subtitle field in feed and items', function(done) { + testParseForFile('subtitle', 'rss', done); + }); })