mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 11:58:49 +01:00
🎨 Improve exporting block hyperlink jumping https://github.com/siyuan-note/siyuan/issues/13837
This commit is contained in:
parent
2ee69394da
commit
713c55ed7a
1 changed files with 6 additions and 5 deletions
|
|
@ -2068,6 +2068,7 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,
|
|||
luteEngine := NewLute()
|
||||
ret = tree
|
||||
id := tree.Root.ID
|
||||
(*treeCache)[tree.ID] = tree
|
||||
|
||||
// 解析查询嵌入节点
|
||||
depth := 0
|
||||
|
|
@ -2799,7 +2800,7 @@ func blockLink2Ref(currentTree *parse.Tree, id string, treeCache *map[string]*pa
|
|||
if nil == b {
|
||||
return
|
||||
}
|
||||
t, err := loadTreeWithCache(b.ID, treeCache)
|
||||
t, err := loadTreeWithCache(b.RootID, treeCache)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
|
@ -2849,7 +2850,7 @@ func collectFootnotesDefs(currentTree *parse.Tree, id string, refFootnotes *[]*r
|
|||
if nil == b {
|
||||
return
|
||||
}
|
||||
t, err := loadTreeWithCache(b.ID, treeCache)
|
||||
t, err := loadTreeWithCache(b.RootID, treeCache)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
|
@ -3122,12 +3123,12 @@ func prepareExportTrees(docPaths []string) (defBlockIDs []string, trees *map[str
|
|||
treeCache := &map[string]*parse.Tree{}
|
||||
defBlockIDs = []string{}
|
||||
for i, p := range docPaths {
|
||||
id := strings.TrimSuffix(path.Base(p), ".sy")
|
||||
if !ast.IsNodeIDPattern(id) {
|
||||
rootID := strings.TrimSuffix(path.Base(p), ".sy")
|
||||
if !ast.IsNodeIDPattern(rootID) {
|
||||
continue
|
||||
}
|
||||
|
||||
tree, err := loadTreeWithCache(id, treeCache)
|
||||
tree, err := loadTreeWithCache(rootID, treeCache)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue