diff --git a/src/__tests__/__snapshots__/atom1.spec.ts.snap b/src/__tests__/__snapshots__/atom1.spec.ts.snap index 569cf1d..3fd7e50 100644 --- a/src/__tests__/__snapshots__/atom1.spec.ts.snap +++ b/src/__tests__/__snapshots__/atom1.spec.ts.snap @@ -3,7 +3,7 @@ exports[`atom 1.0 should generate a valid feed 1`] = ` " - http://example.com/ + http://example.com/?link=sanitized&value=4 Feed Title 2013-07-13T23:00:00.000Z https://github.com/jpmonette/feed @@ -12,12 +12,12 @@ exports[`atom 1.0 should generate a valid feed 1`] = ` johndoe@example.com https://example.com/johndoe?link=sanitized&value=2 - - + + This is my personnal feed! - http://example.com/image.png - http://example.com/image.ico + http://example.com/image.png?link=sanitized&value=6 + http://example.com/image.ico?link=sanitized&value=7 All rights reserved 2013, John Doe diff --git a/src/__tests__/__snapshots__/json.spec.ts.snap b/src/__tests__/__snapshots__/json.spec.ts.snap index 985e696..0f235cd 100644 --- a/src/__tests__/__snapshots__/json.spec.ts.snap +++ b/src/__tests__/__snapshots__/json.spec.ts.snap @@ -4,10 +4,10 @@ exports[`json 1 should generate a valid feed 1`] = ` "{ \\"version\\": \\"https://jsonfeed.org/version/1\\", \\"title\\": \\"Feed Title\\", - \\"home_page_url\\": \\"http://example.com/\\", - \\"feed_url\\": \\"http://example.com/sampleFeed.json\\", + \\"home_page_url\\": \\"http://example.com/?link=sanitized&value=3\\", + \\"feed_url\\": \\"http://example.com/sampleFeed.json?link=sanitized&value=5\\", \\"description\\": \\"This is my personnal feed!\\", - \\"icon\\": \\"http://example.com/image.png\\", + \\"icon\\": \\"http://example.com/image.png?link=sanitized&value=6\\", \\"author\\": { \\"name\\": \\"John Doe\\", \\"url\\": \\"https://example.com/johndoe?link=sanitized&value=2\\" diff --git a/src/__tests__/__snapshots__/rss2.spec.ts.snap b/src/__tests__/__snapshots__/rss2.spec.ts.snap index 6cb59bc..50b4f8c 100644 --- a/src/__tests__/__snapshots__/rss2.spec.ts.snap +++ b/src/__tests__/__snapshots__/rss2.spec.ts.snap @@ -5,7 +5,7 @@ exports[`rss 2.0 should generate a valid feed 1`] = ` Feed Title - http://example.com/ + http://example.com/?link=sanitized&value=3 This is my personnal feed! Sat, 13 Jul 2013 23:00:00 GMT https://validator.w3.org/feed/docs/rss2.html @@ -14,8 +14,8 @@ exports[`rss 2.0 should generate a valid feed 1`] = ` 60 Feed Title - http://example.com/image.png - http://example.com/ + http://example.com/image.png?link=sanitized&value=6 + http://example.com/?link=sanitized&value=3 All rights reserved 2013, John Doe Technology @@ -42,7 +42,7 @@ exports[`rss 2.0 should generate a valid feed with audio 1`] = ` Feed Title - http://example.com/ + http://example.com/?link=sanitized&value=3 This is my personnal feed! Sat, 13 Jul 2013 23:00:00 GMT https://validator.w3.org/feed/docs/rss2.html @@ -51,8 +51,8 @@ exports[`rss 2.0 should generate a valid feed with audio 1`] = ` 60 Feed Title - http://example.com/image.png - http://example.com/ + http://example.com/image.png?link=sanitized&value=6 + http://example.com/?link=sanitized&value=3 All rights reserved 2013, John Doe Technology @@ -118,7 +118,7 @@ exports[`rss 2.0 should generate a valid feed with enclosure 1`] = ` Feed Title - http://example.com/ + http://example.com/?link=sanitized&value=3 This is my personnal feed! Sat, 13 Jul 2013 23:00:00 GMT https://validator.w3.org/feed/docs/rss2.html @@ -127,8 +127,8 @@ exports[`rss 2.0 should generate a valid feed with enclosure 1`] = ` 60 Feed Title - http://example.com/image.png - http://example.com/ + http://example.com/image.png?link=sanitized&value=6 + http://example.com/?link=sanitized&value=3 All rights reserved 2013, John Doe Technology @@ -181,7 +181,7 @@ exports[`rss 2.0 should generate a valid feed with image properties 1`] = ` Feed Title - http://example.com/ + http://example.com/?link=sanitized&value=3 This is my personnal feed! Sat, 13 Jul 2013 23:00:00 GMT https://validator.w3.org/feed/docs/rss2.html @@ -190,8 +190,8 @@ exports[`rss 2.0 should generate a valid feed with image properties 1`] = ` 60 Feed Title - http://example.com/image.png - http://example.com/ + http://example.com/image.png?link=sanitized&value=6 + http://example.com/?link=sanitized&value=3 All rights reserved 2013, John Doe Technology diff --git a/src/__tests__/setup.ts b/src/__tests__/setup.ts index 79d77f7..bcdd8eb 100644 --- a/src/__tests__/setup.ts +++ b/src/__tests__/setup.ts @@ -6,16 +6,16 @@ export const published = new Date("Sat, 10 Jul 2013 23:00:00 GMT"); export const sampleFeed = new Feed({ title: "Feed Title", description: "This is my personnal feed!", - link: "http://example.com/", - id: "http://example.com/", - feed: "http://example.com/sampleFeed.rss", + link: "http://example.com/?link=sanitized&value=3", + id: "http://example.com/?link=sanitized&value=4", + feed: "http://example.com/sampleFeed.rss?link=sanitized&value=2", feedLinks: { - json: "http://example.com/sampleFeed.json", + json: "http://example.com/sampleFeed.json?link=sanitized&value=5", }, language: "en", ttl: 60, - image: "http://example.com/image.png", - favicon: "http://example.com/image.ico", + image: "http://example.com/image.png?link=sanitized&value=6", + favicon: "http://example.com/image.ico?link=sanitized&value=7", copyright: "All rights reserved 2013, John Doe", hub: "wss://example.com/", updated, // optional, default = today diff --git a/src/atom1.ts b/src/atom1.ts index 3bfe29b..2368a53 100644 --- a/src/atom1.ts +++ b/src/atom1.ts @@ -34,7 +34,7 @@ export default (ins: Feed) => { } // link (rel="self") - const atomLink = sanitize(options.feed || (options.feedLinks && options.feedLinks.atom)); + const atomLink = options.feed || (options.feedLinks && options.feedLinks.atom); if (atomLink) { base.feed.link.push({ _attributes: { rel: "self", href: sanitize(atomLink) } });