Skip to content

Commit cb413ed

Browse files
authored
Merge pull request #14631 from JoeChenJ/fix-rss--parsing
fix rss parsing logic
2 parents 4051a0b + 88992ee commit cb413ed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/api/fetchRSS.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export const fetchRSS = async (xmlUrl: string | string[]) => {
4242
// Map to RSSItem object
4343
.map((item) => {
4444
const getImgSrc = () => {
45+
if (url.includes("medium.com/feed/"))
46+
return item["content:encoded"]?.[0].match(
47+
/https?:\/\/[^"]*?\.(jpe?g|png|webp)/g
48+
)
4549
if (item.enclosure) return item.enclosure[0].$.url
4650
if (item["media:content"]) return item["media:content"][0].$.url
4751
return channelImage

0 commit comments

Comments
 (0)