We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a99b0fe commit e30e437Copy full SHA for e30e437
src/utils/node/feed.ts
@@ -2,7 +2,7 @@ import { parseStringPromise } from 'xml2js'
2
import get from 'lodash.get'
3
import { Feed } from '@/types/reader'
4
5
-const trim = (s: string) => s.replaceAll('\n', '').trim()
+const trim = (s = '') => s.replaceAll('\n', '').trim()
6
7
const gettrim = (...args: Parameters<typeof get>) => trim(get(...args))
8
@@ -16,7 +16,7 @@ const parseRss = (xml: any): Omit<Feed, 'url'> => {
16
items: (channel.item || []).map((v: any) => ({
17
title: gettrim(v, 'title[0]'),
18
url: gettrim(v, 'link[0]'),
19
- content: gettrim(v, 'description[0]'),
+ content: gettrim(v, 'content:encoded[0]') || gettrim(v, 'description[0]'),
20
pubTime: gettrim(v, 'pubDate[0]'),
21
})),
22
}
0 commit comments