From e4db178629dca25b4593a1c5d8518af21c725688 Mon Sep 17 00:00:00 2001 From: SeptemberHX Date: Tue, 2 Aug 2022 20:07:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(route):=20infoq=20=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=86=85=E5=AE=B9=E8=A7=A3=E6=9E=90=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=AF=BC=E8=87=B4=E6=97=A0=E6=B3=95=E7=94=9F=E6=88=90?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E6=96=87=E4=BB=B6=20(#10376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/v2/infoq/utils.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/v2/infoq/utils.js b/lib/v2/infoq/utils.js index 468030bbb6..bb5f7ec421 100644 --- a/lib/v2/infoq/utils.js +++ b/lib/v2/infoq/utils.js @@ -58,8 +58,12 @@ const parseToSimpleTexts = (content) => } }, blockquote: () => { - const text = parseToSimpleText(i.content); - return `
${text}
`; + if (i.content) { + const text = parseToSimpleText(i.content); + return `
${text}
`; + } 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 `${text}"`; }, };