fix(route): infoq 部分文章内容解析错误导致无法生成订阅文件 (#10376)

This commit is contained in:
SeptemberHX
2022-08-02 20:07:34 +08:00
committed by GitHub
parent 26a304a8cf
commit e4db178629
+7 -3
View File
@@ -58,8 +58,12 @@ const parseToSimpleTexts = (content) =>
}
},
blockquote: () => {
const text = parseToSimpleText(i.content);
return `<blockquote>${text}</blockquote>`;
if (i.content) {
const text = parseToSimpleText(i.content);
return `<blockquote>${text}</blockquote>`;
} else {
return '';
}
},
image: () => {
const img = i.attrs.src;
@@ -76,7 +80,7 @@ const parseToSimpleTexts = (content) =>
},
link: () => {
const href = i.attrs.href;
const text = parseToSimpleText(i.content);
const text = i.content ? parseToSimpleText(i.content) : '';
return `<a href="${href}">${text}</a>"`;
},
};