🐛 When the heading block and super block are used together, repeating content if unfolding the heading https://github.com/siyuan-note/siyuan/issues/9435

This commit is contained in:
Daniel 2023-10-16 00:09:16 +08:00
parent 166dd4a1c3
commit 4a832e89f8
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 36 additions and 2 deletions

View file

@ -46,7 +46,7 @@ func (tx *Transaction) doFoldHeading(operation *Operation) (ret *TxErr) {
return &TxErr{code: TxErrCodeBlockNotFound, id: headingID}
}
children := treenode.HeadingChildren(heading)
children := treenode.HeadingChildren4Folding(heading)
for _, child := range children {
childrenIDs = append(childrenIDs, child.ID)
child.SetIALAttr("fold", "1")
@ -80,7 +80,7 @@ func (tx *Transaction) doUnfoldHeading(operation *Operation) (ret *TxErr) {
return &TxErr{code: TxErrCodeBlockNotFound, id: headingID}
}
children := treenode.HeadingChildren(heading)
children := treenode.HeadingChildren4Folding(heading)
for _, child := range children {
child.RemoveIALAttr("heading-fold")
child.RemoveIALAttr("fold")
@ -98,6 +98,7 @@ func (tx *Transaction) doUnfoldHeading(operation *Operation) (ret *TxErr) {
}
sql.UpsertTreeQueue(tree)
children = treenode.HeadingChildren(heading)
luteEngine := NewLute()
operation.RetData = renderBlockDOMByNodes(children, luteEngine)
return