mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
🧑💻 Improve kernel API appendBlock and insertBlock https://github.com/siyuan-note/siyuan/issues/15798
This commit is contained in:
parent
29244a1f8c
commit
6510d7dbf0
1 changed files with 12 additions and 4 deletions
|
|
@ -1255,11 +1255,19 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) {
|
|||
node.FirstChild.InsertAfter(remain)
|
||||
}
|
||||
} else {
|
||||
for i := len(remains) - 1; 0 <= i; i-- {
|
||||
remain := remains[i]
|
||||
node.PrependChild(remain)
|
||||
if !node.IsContainerBlock() {
|
||||
for i := len(remains) - 1; 0 <= i; i-- {
|
||||
remain := remains[i]
|
||||
node.InsertAfter(remain)
|
||||
}
|
||||
node.InsertAfter(insertedNode)
|
||||
} else {
|
||||
for i := len(remains) - 1; 0 <= i; i-- {
|
||||
remain := remains[i]
|
||||
node.PrependChild(remain)
|
||||
}
|
||||
node.PrependChild(insertedNode)
|
||||
}
|
||||
node.PrependChild(insertedNode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue