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; }