Skip to content
Draft
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions lib/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ fields.feed = [
['dc:type', 'type'],
'title',
'description',
'subtitle',
'author',
'pubDate',
'webMaster',
Expand All @@ -35,6 +36,7 @@ fields.item = [
['dc:source', 'source'],
['dc:title', 'title'],
'title',
'subtitle',
'link',
'pubDate',
'author',
Expand Down
27 changes: 27 additions & 0 deletions test/input/subtitle.rss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Example Blog</title>
<link>https://example.com/blog</link>
<description>A blog about technology and programming</description>
<subtitle>Tech insights and tutorials</subtitle>
<language>en-us</language>
<lastBuildDate>Mon, 15 Jan 2024 10:00:00 GMT</lastBuildDate>
<item>
<title>First Post</title>
<subtitle>An introduction to our blog</subtitle>
<link>https://example.com/blog/post-1</link>
<description>Welcome to our blog!</description>
<pubDate>Mon, 15 Jan 2024 10:00:00 GMT</pubDate>
<guid>https://example.com/blog/post-1</guid>
</item>
<item>
<title>Second Post</title>
<subtitle>More content for readers</subtitle>
<link>https://example.com/blog/post-2</link>
<description>Here is another post.</description>
<pubDate>Sun, 14 Jan 2024 09:00:00 GMT</pubDate>
<guid>https://example.com/blog/post-2</guid>
</item>
</channel>
</rss>
32 changes: 32 additions & 0 deletions test/output/subtitle.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
4 changes: 4 additions & 0 deletions test/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
})