mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-25 16:34:06 +01:00
🎨 Refresh associated blocks after find-replacing and rolling back doc
https://github.com/siyuan-note/siyuan/issues/12439 https://github.com/siyuan-note/siyuan/issues/12438
This commit is contained in:
parent
e2cb9fe453
commit
8b2c08439f
10 changed files with 235 additions and 167 deletions
|
|
@ -215,21 +215,21 @@ func getNodeRefText0(node *ast.Node) string {
|
|||
return ret
|
||||
}
|
||||
|
||||
func GetBlockRefIDs(id string) (refIDs, refTexts, defIDs []string) {
|
||||
func GetBlockRefs(defID string) (refIDs, refTexts, defIDs []string) {
|
||||
refIDs = []string{}
|
||||
refTexts = []string{}
|
||||
defIDs = []string{}
|
||||
bt := treenode.GetBlockTree(id)
|
||||
bt := treenode.GetBlockTree(defID)
|
||||
if nil == bt {
|
||||
return
|
||||
}
|
||||
|
||||
isDoc := bt.ID == bt.RootID
|
||||
refIDs, refTexts = sql.QueryRefIDsByDefID(id, isDoc)
|
||||
refIDs, refTexts = sql.QueryRefIDsByDefID(defID, isDoc)
|
||||
if isDoc {
|
||||
defIDs = sql.QueryChildDefIDsByRootDefID(id)
|
||||
defIDs = sql.QueryChildDefIDsByRootDefID(defID)
|
||||
} else {
|
||||
defIDs = append(defIDs, id)
|
||||
defIDs = append(defIDs, defID)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue