️ 完善换行处理

This commit is contained in:
目棃
2024-03-09 19:52:33 +08:00
parent 4729fc7d4a
commit 7de0b73e6d
2 changed files with 6 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
<component
v-for="(tp, index) in props.data"
:key="index"
:is="getTpName(tp, index)"
:is="getTpName(tp)"
:data="tp"
:next="getTpNext(index)"
/>
@@ -25,7 +25,7 @@ interface TpParserProps {
const props = defineProps<TpParserProps>();
function getTpName(tp: TGApp.Plugins.Mys.SctPost.Base, index: number) {
function getTpName(tp: TGApp.Plugins.Mys.SctPost.Base) {
if (typeof tp.insert === "string") {
return TpText;
} else if ("image" in tp.insert) {

View File

@@ -102,8 +102,10 @@ function getTextStyle(): StyleValue {
const style = <Array<StyleValue>>[];
let data: TpText;
if (props.data.insert === "\n") {
style.push("display: inline");
return style;
if (props.data.attributes?.align || props.data.attributes?.header) {
return "display: none";
}
return "display: inline";
}
if (props.next?.insert === "\n") {
data = {