From 3425919816779a8e105769deae5e6df63a28e1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Tue, 3 Sep 2024 15:11:10 +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=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=81=97=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/post/tp-parser.vue | 7 ++++++- src/components/postReply/tpr-reply.vue | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/post/tp-parser.vue b/src/components/post/tp-parser.vue index 3ed99595..a4efff73 100644 --- a/src/components/post/tp-parser.vue +++ b/src/components/post/tp-parser.vue @@ -60,6 +60,11 @@ function getParsedData(data: TGApp.Plugins.Mys.SctPost.Base[]): TGApp.Plugins.My const text = parsedText[i]; child.push(parsedText[i]); if (text.insert === "\n") { + if (child.length === 1) { + res.push(child[0]); + child = []; + continue; + } cur = { insert: "", attributes: text.attributes, @@ -70,7 +75,7 @@ function getParsedData(data: TGApp.Plugins.Mys.SctPost.Base[]): TGApp.Plugins.My child = []; } } - if (check !== parsedText.length - 1 && child.length > 1) res.push(...child); + if (check !== parsedText.length - 1 && child.length > 0) res.push(...child); } if (res.length === 0 && child.length > 0) res.push(...child); return res; diff --git a/src/components/postReply/tpr-reply.vue b/src/components/postReply/tpr-reply.vue index de34ce57..672cd0c9 100644 --- a/src/components/postReply/tpr-reply.vue +++ b/src/components/postReply/tpr-reply.vue @@ -45,7 +45,6 @@ @click="showReply()" > mdi-message-text - {{ props.modelValue.sub_replies.length }}