From babdb58d2f010a51ea5730a60deea52202164987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Mon, 2 Sep 2024 15:37:59 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/post/tp-parser.vue | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/components/post/tp-parser.vue b/src/components/post/tp-parser.vue index fce49f43..646c11ba 100644 --- a/src/components/post/tp-parser.vue +++ b/src/components/post/tp-parser.vue @@ -68,22 +68,10 @@ function getParsedData(data: TGApp.Plugins.Mys.SctPost.Base[]): TGApp.Plugins.My check += child.length; child = []; } - if (i === parsedText.length - 1 && check !== parsedText.length) { - if (child.length === 1) { - res.push(child[0]); - child = []; - continue; - } - cur = { - insert: "", - attributes: text.attributes, - children: child, - }; - res.push(cur); - child = []; - } } + if (check !== parsedText.length - 1 && child.length > 1) res.push(...child); } + if (res.length === 0 && child.length > 0) res.push(...child); return res; }