️ 完善换行处理

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 <component
v-for="(tp, index) in props.data" v-for="(tp, index) in props.data"
:key="index" :key="index"
:is="getTpName(tp, index)" :is="getTpName(tp)"
:data="tp" :data="tp"
:next="getTpNext(index)" :next="getTpNext(index)"
/> />
@@ -25,7 +25,7 @@ interface TpParserProps {
const props = defineProps<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") { if (typeof tp.insert === "string") {
return TpText; return TpText;
} else if ("image" in tp.insert) { } else if ("image" in tp.insert) {

View File

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