Skip to content

Commit

Permalink
Merge 0118475 into 96c6aec
Browse files Browse the repository at this point in the history
  • Loading branch information
deadcoder0904 committed Oct 18, 2020
2 parents 96c6aec + 0118475 commit cae694c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/__tests__/__snapshots__/rss2.spec.ts.snap
Expand Up @@ -29,6 +29,7 @@ exports[`rss 2.0 should generate a valid feed 1`] = `
<content:encoded><![CDATA[Content of my item]]></content:encoded>
<author>janedoe@example.com (Jane Doe)</author>
<author>joesmith@example.com (Joe Smith)</author>
<dc:creator><![CDATA[Joe Smith, Name Only]]></dc:creator>
<category>Grateful Dead</category>
<category domain=\\"http://www.fool.com/cusips\\">MSFT</category>
<enclosure url=\\"https://example.com/hello-world.jpg\\" length=\\"0\\" type=\\"image/jpg\\"/>
Expand Down Expand Up @@ -66,6 +67,7 @@ exports[`rss 2.0 should generate a valid feed with audio 1`] = `
<content:encoded><![CDATA[Content of my item]]></content:encoded>
<author>janedoe@example.com (Jane Doe)</author>
<author>joesmith@example.com (Joe Smith)</author>
<dc:creator><![CDATA[Joe Smith, Name Only]]></dc:creator>
<category>Grateful Dead</category>
<category domain=\\"http://www.fool.com/cusips\\">MSFT</category>
<enclosure url=\\"https://example.com/hello-world.jpg\\" length=\\"0\\" type=\\"image/jpg\\"/>
Expand All @@ -79,6 +81,7 @@ exports[`rss 2.0 should generate a valid feed with audio 1`] = `
<content:encoded><![CDATA[Content of my item]]></content:encoded>
<author>janedoe@example.com (Jane Doe)</author>
<author>joesmith@example.com (Joe Smith)</author>
<dc:creator><![CDATA[Joe Smith]]></dc:creator>
<category>Grateful Dead</category>
<category domain=\\"http://www.fool.com/cusips\\">MSFT</category>
<enclosure length=\\"12665\\" type=\\"image/jpg\\" url=\\"https://example.com/hello-world.jpg\\"/>
Expand All @@ -92,6 +95,7 @@ exports[`rss 2.0 should generate a valid feed with audio 1`] = `
<content:encoded><![CDATA[Content of my item]]></content:encoded>
<author>janedoe@example.com (Jane Doe)</author>
<author>joesmith@example.com (Joe Smith)</author>
<dc:creator><![CDATA[Joe Smith]]></dc:creator>
<category>Grateful Dead</category>
<category domain=\\"http://www.fool.com/cusips\\">MSFT</category>
<enclosure length=\\"12665\\" type=\\"image/jpg\\" url=\\"https://example.com/hello-world.jpg\\"/>
Expand All @@ -105,6 +109,7 @@ exports[`rss 2.0 should generate a valid feed with audio 1`] = `
<content:encoded><![CDATA[Content of my item]]></content:encoded>
<author>janedoe@example.com (Jane Doe)</author>
<author>joesmith@example.com (Joe Smith)</author>
<dc:creator><![CDATA[Joe Smith]]></dc:creator>
<category>Grateful Dead</category>
<category domain=\\"http://www.fool.com/cusips\\">MSFT</category>
<enclosure length=\\"12665\\" type=\\"audio/mpeg\\" url=\\"https://example.com/hello-world.mp3\\"/>
Expand Down Expand Up @@ -142,6 +147,7 @@ exports[`rss 2.0 should generate a valid feed with enclosure 1`] = `
<content:encoded><![CDATA[Content of my item]]></content:encoded>
<author>janedoe@example.com (Jane Doe)</author>
<author>joesmith@example.com (Joe Smith)</author>
<dc:creator><![CDATA[Joe Smith, Name Only]]></dc:creator>
<category>Grateful Dead</category>
<category domain=\\"http://www.fool.com/cusips\\">MSFT</category>
<enclosure url=\\"https://example.com/hello-world.jpg\\" length=\\"0\\" type=\\"image/jpg\\"/>
Expand All @@ -155,6 +161,7 @@ exports[`rss 2.0 should generate a valid feed with enclosure 1`] = `
<content:encoded><![CDATA[Content of my item]]></content:encoded>
<author>janedoe@example.com (Jane Doe)</author>
<author>joesmith@example.com (Joe Smith)</author>
<dc:creator><![CDATA[Joe Smith]]></dc:creator>
<category>Grateful Dead</category>
<category domain=\\"http://www.fool.com/cusips\\">MSFT</category>
<enclosure length=\\"12665\\" type=\\"image/jpg\\" url=\\"https://example.com/hello-world.jpg\\"/>
Expand All @@ -168,6 +175,7 @@ exports[`rss 2.0 should generate a valid feed with enclosure 1`] = `
<content:encoded><![CDATA[Content of my item]]></content:encoded>
<author>janedoe@example.com (Jane Doe)</author>
<author>joesmith@example.com (Joe Smith)</author>
<dc:creator><![CDATA[Joe Smith]]></dc:creator>
<category>Grateful Dead</category>
<category domain=\\"http://www.fool.com/cusips\\">MSFT</category>
<enclosure length=\\"12665\\" type=\\"image/jpg\\" url=\\"https://example.com/hello-world.jpg\\"/>
Expand Down Expand Up @@ -205,6 +213,7 @@ exports[`rss 2.0 should generate a valid feed with image properties 1`] = `
<content:encoded><![CDATA[Content of my item]]></content:encoded>
<author>janedoe@example.com (Jane Doe)</author>
<author>joesmith@example.com (Joe Smith)</author>
<dc:creator><![CDATA[Joe Smith, Name Only]]></dc:creator>
<category>Grateful Dead</category>
<category domain=\\"http://www.fool.com/cusips\\">MSFT</category>
<enclosure url=\\"https://example.com/hello-world.jpg\\" length=\\"0\\" type=\\"image/jpg\\"/>
Expand All @@ -218,6 +227,7 @@ exports[`rss 2.0 should generate a valid feed with image properties 1`] = `
<content:encoded><![CDATA[Content of my item]]></content:encoded>
<author>janedoe@example.com (Jane Doe)</author>
<author>joesmith@example.com (Joe Smith)</author>
<dc:creator><![CDATA[Joe Smith]]></dc:creator>
<category>Grateful Dead</category>
<category domain=\\"http://www.fool.com/cusips\\">MSFT</category>
<enclosure length=\\"12665\\" type=\\"image/jpg\\" url=\\"https://example.com/hello-world.jpg\\"/>
Expand Down Expand Up @@ -254,6 +264,7 @@ exports[`rss 2.0 should generate a valid feed with video 1`] = `
<content:encoded><![CDATA[Content of my item]]></content:encoded>
<author>janedoe@example.com (Jane Doe)</author>
<author>joesmith@example.com (Joe Smith)</author>
<dc:creator><![CDATA[Joe Smith]]></dc:creator>
<category>Grateful Dead</category>
<category domain=\\"http://www.fool.com/cusips\\">MSFT</category>
<enclosure url=\\"https://example.com/hello-world.mp4\\" length=\\"0\\" type=\\"video/mp4\\"/>
Expand Down
1 change: 1 addition & 0 deletions src/rss2.ts
Expand Up @@ -157,6 +157,7 @@ export default (ins: Feed) => {
if (Array.isArray(entry.author)) {
item.author = [];
entry.author.map((author: Author) => {
item["dc:creator"] = { _cdata: author.name };
if (author.email && author.name) {
item.author.push({ _text: author.email + " (" + author.name + ")" });
}
Expand Down

0 comments on commit cae694c

Please sign in to comment.