Skip to content

Commit 95d2617

Browse files
authored
Merge pull request #4 from xwcoder/feature/reader
Feature/reader
2 parents 317ba1a + e30e437 commit 95d2617

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# emo
2+
[Download](https://github.com/xwcoder/emo/releases) | [Issue](https://github.com/xwcoder/emo/issues/new)
23

34
I wish to develop **emo** as an **all in one** desktop application. Now, it includes the following apps:
45
- **Reader** - A rss reader.

src/utils/node/feed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { parseStringPromise } from 'xml2js'
22
import get from 'lodash.get'
33
import { Feed } from '@/types/reader'
44

5-
const trim = (s: string) => s.replaceAll('\n', '').trim()
5+
const trim = (s = '') => s.replaceAll('\n', '').trim()
66

77
const gettrim = (...args: Parameters<typeof get>) => trim(get(...args))
88

@@ -16,7 +16,7 @@ const parseRss = (xml: any): Omit<Feed, 'url'> => {
1616
items: (channel.item || []).map((v: any) => ({
1717
title: gettrim(v, 'title[0]'),
1818
url: gettrim(v, 'link[0]'),
19-
content: gettrim(v, 'description[0]'),
19+
content: gettrim(v, 'content:encoded[0]') || gettrim(v, 'description[0]'),
2020
pubTime: gettrim(v, 'pubDate[0]'),
2121
})),
2222
}

0 commit comments

Comments
 (0)