From c682443e6f33e0464e66f1374fe060e6331ecdfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Sat, 31 Aug 2024 12:39:34 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E7=89=B9?= =?UTF-8?q?=E5=AE=9A=E6=83=85=E5=86=B5=E4=B8=8B=E7=9A=84=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/post/tp-parser.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/post/tp-parser.vue b/src/components/post/tp-parser.vue index 083fd1e2..d6426ace 100644 --- a/src/components/post/tp-parser.vue +++ b/src/components/post/tp-parser.vue @@ -66,6 +66,16 @@ function getParsedData(data: TGApp.Plugins.Mys.SctPost.Base[]): TGApp.Plugins.My child = []; } } + // 可能没有换行符,导致res为空 + if (res.length === 0) { + cur = { + insert: "", + attributes: tp.attributes, + children: child, + }; + res.push(cur); + child = []; + } } return res; }