Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2024-05-23 11:07:37 +08:00
commit f10c0bcd4d

View file

@ -2556,6 +2556,38 @@ func exportRefTrees0(tree *parse.Tree, retTrees *map[string]*parse.Tree) {
}
exportRefTrees0(defTree, retTrees)
} else if ast.NodeAttributeView == n.Type {
// 导出数据库所在文档时一并导出绑定块所在文档
// Export the binding block docs when exporting the doc where the database is located https://github.com/siyuan-note/siyuan/issues/11486
avID := n.AttributeViewID
if "" == avID {
return ast.WalkContinue
}
attrView, _ := av.ParseAttributeView(avID)
if nil == attrView {
return ast.WalkContinue
}
blockKeyValues := attrView.GetBlockKeyValues()
if nil == blockKeyValues {
return ast.WalkContinue
}
for _, val := range blockKeyValues.Values {
defBlock := treenode.GetBlockTree(val.BlockID)
if nil == defBlock {
continue
}
defTree, _ := LoadTreeByBlockID(defBlock.RootID)
if nil == defTree {
continue
}
exportRefTrees0(defTree, retTrees)
}
}
return ast.WalkContinue
})