🐛 修复特定情况下的渲染错误,调整z-index,子回复持久化

This commit is contained in:
目棃
2024-09-04 22:00:59 +08:00
parent c34b9d2416
commit 67f89dd998
4 changed files with 61 additions and 23 deletions

View File

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