diff --git a/kernel/model/export.go b/kernel/model/export.go index 6bfa335a4..be7f5f272 100644 --- a/kernel/model/export.go +++ b/kernel/model/export.go @@ -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 }