mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
🎨 调用 API setBlockAttrs 后推送 Transaction Fix https://github.com/siyuan-note/siyuan/issues/5847
自定义属性更改与删除异常 Fix https://github.com/siyuan-note/siyuan/issues/5841
This commit is contained in:
parent
cc52aff0cb
commit
f15361bdd7
2 changed files with 22 additions and 11 deletions
|
|
@ -904,17 +904,6 @@ func (tx *Transaction) doUpdate(operation *Operation) (ret *TxErr) {
|
|||
treenode.MoveFoldHeading(updatedNode, oldNode)
|
||||
}
|
||||
|
||||
// 挂件移动或设置大小后属性丢失 https://github.com/siyuan-note/siyuan/issues/4885
|
||||
// 这里需要把旧节点的属性复制到新节点上,避免属性丢失
|
||||
oldIAL := parse.IAL2Map(oldNode.KramdownIAL)
|
||||
newIAL := parse.IAL2Map(updatedNode.KramdownIAL)
|
||||
for oldIALKey, oldIALVal := range oldIAL {
|
||||
if strings.HasPrefix(oldIALKey, "custom-") {
|
||||
newIAL[oldIALKey] = oldIALVal
|
||||
}
|
||||
}
|
||||
updatedNode.KramdownIAL = parse.Map2IAL(newIAL)
|
||||
|
||||
cache.PutBlockIAL(updatedNode.ID, parse.IAL2Map(updatedNode.KramdownIAL))
|
||||
|
||||
// 替换为新节点
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue