mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
🎨 Improve database primary key content update for bound container blocks https://github.com/siyuan-note/siyuan/issues/12664
This commit is contained in:
parent
0dbc8c2933
commit
512e72700c
1 changed files with 17 additions and 0 deletions
|
|
@ -234,7 +234,24 @@ func refreshDynamicRefTexts(updatedDefNodes map[string]*ast.Node, updatedTrees m
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 更新属性视图主键内容
|
// 2. 更新属性视图主键内容
|
||||||
|
var parents []*ast.Node
|
||||||
for _, updatedDefNode := range updatedDefNodes {
|
for _, updatedDefNode := range updatedDefNodes {
|
||||||
|
parent := updatedDefNode.Parent
|
||||||
|
for ; nil != parent && ast.NodeDocument != parent.Type && parent.IsContainerBlock(); parent = parent.Parent {
|
||||||
|
if ast.NodeDocument != parent.Type && parent.IsContainerBlock() && treenode.FirstLeafBlock(parent) == updatedDefNode {
|
||||||
|
parents = append(parents, parent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, parent := range parents {
|
||||||
|
updatedDefNodes[parent.ID] = parent
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, updatedDefNode := range updatedDefNodes {
|
||||||
|
if nil != updatedDefNode.Parent && ast.NodeDocument != updatedDefNode.Parent.Type &&
|
||||||
|
updatedDefNode.Parent.IsContainerBlock() && treenode.FirstLeafBlock(updatedDefNode.Parent) == updatedDefNode {
|
||||||
|
updatedDefNode = updatedDefNode.Parent
|
||||||
|
}
|
||||||
avs := updatedDefNode.IALAttr(av.NodeAttrNameAvs)
|
avs := updatedDefNode.IALAttr(av.NodeAttrNameAvs)
|
||||||
if "" == avs {
|
if "" == avs {
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue