fix: 解决infoQ全文获取异常 (#5065)

This commit is contained in:
tgly307
2020-06-28 11:19:49 +08:00
committed by GitHub
parent c999b0a60a
commit 568184b911

View File

@@ -50,9 +50,13 @@ const parseToSimpleTexts = (content) =>
.join(''),
text: () => i.text,
heading: () => {
const level = i.attrs.level;
const text = parseToSimpleText(i.content);
return `<h${level}>${text}</h${level}>`;
if (i.content) {
const level = i.attrs.level;
const text = parseToSimpleText(i.content);
return `<h${level}>${text}</h${level}>`;
} else {
return '';
}
},
blockquote: () => {
const text = parseToSimpleText(i.content);