From 67f89dd9984ff1c5ead76e5b78ee327855534499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Wed, 4 Sep 2024 22:00:59 +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?=E9=94=99=E8=AF=AF=EF=BC=8C=E8=B0=83=E6=95=B4z-index=EF=BC=8C?= =?UTF-8?q?=E5=AD=90=E5=9B=9E=E5=A4=8D=E6=8C=81=E4=B9=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/post/tp-parser.vue | 14 ++++----- src/components/postReply/tpr-debug.vue | 2 +- src/components/postReply/tpr-main.vue | 26 +++++++++------- src/components/postReply/tpr-reply.vue | 42 ++++++++++++++++++++++++-- 4 files changed, 61 insertions(+), 23 deletions(-) diff --git a/src/components/post/tp-parser.vue b/src/components/post/tp-parser.vue index b90fc9ce..f4e5c54a 100644 --- a/src/components/post/tp-parser.vue +++ b/src/components/post/tp-parser.vue @@ -58,24 +58,22 @@ function getParsedData(data: TGApp.Plugins.Mys.SctPost.Base[]): TGApp.Plugins.My let check = 0; for (let i = 0; i < parsedText.length; i++) { const text = parsedText[i]; - child.push(parsedText[i]); + child.push(text); if (text.insert === "\n") { - if (child.length === 1) { - res.push(child[0]); - child = []; - continue; - } + check += child.length; cur = { insert: "", attributes: text.attributes, children: child, }; res.push(cur); - check += child.length; child = []; } } - if (check !== parsedText.length - 1 && child.length > 1) res.push(...child); + if (check !== parsedText.length && check !== 0) { + res.push(...child); + child = []; + } } if (res.length === 0 && child.length > 0) res.push(...child); return res; diff --git a/src/components/postReply/tpr-debug.vue b/src/components/postReply/tpr-debug.vue index 58d40b73..d3392770 100644 --- a/src/components/postReply/tpr-debug.vue +++ b/src/components/postReply/tpr-debug.vue @@ -1,5 +1,5 @@