Skip to content

Commit

Permalink
fix: inability to import RSS articles due to additional attributes (#34)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/kind bug

#### What this PR does / why we need it:

将 rss 解析 xml 时的 `ignoreAttributes` 属性设置为 true。用于避免可能出现的由于额外属性而导致导入失败的问题。

#### How to test it?

使用具有额外属性的 RSS,例如 `<content:encoded xml:lang="zh-CN">` 等进行导入,查看导入是否成功。

#### Which issue(s) this PR fixes:

Fixes #32 

#### Does this PR introduce a user-facing change?
```release-note
解决由于额外属性所导致的导入失败的问题。
```
  • Loading branch information
LIlGG committed Jan 8, 2024
1 parent 4333476 commit 3009f24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ application-local.properties
/workplace/
node_modules
/docs/.vitepress/cache/
/src/main/resources/console/
2 changes: 1 addition & 1 deletion console/src/modules/rss/use-rss-data-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface useRssDataParserReturn {

const isArrayPath = ["rss.channel.item"];
const parser = new XMLParser({
ignoreAttributes: false,
ignoreAttributes: true,
attributeNamePrefix: "_",
textNodeName: "value",
isArray: (name, jpath, isLeafNode, isAttribute) => {
Expand Down

0 comments on commit 3009f24

Please sign in to comment.