mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 14:28:49 +01:00
🧑💻 Improve kernel API /api/block/updateBlock and /api/block/batchUpdateBlock https://github.com/siyuan-note/siyuan/issues/15301
This commit is contained in:
parent
70e31c71cc
commit
56a5f13728
5 changed files with 66 additions and 140 deletions
|
|
@ -207,6 +207,17 @@ func LoadTreeByBlockIDWithReindex(id string) (ret *parse.Tree, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func LoadTreeWithCache(id string, treeCache *map[string]*parse.Tree) (tree *parse.Tree, err error) {
|
||||
if tree = (*treeCache)[id]; nil != tree {
|
||||
return
|
||||
}
|
||||
tree, err = LoadTreeByBlockID(id)
|
||||
if nil == err && nil != tree {
|
||||
(*treeCache)[id] = tree
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func LoadTreeByBlockID(id string) (ret *parse.Tree, err error) {
|
||||
if !ast.IsNodeIDPattern(id) {
|
||||
stack := logging.ShortStack()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue