From 22ab71b72fc5872f655736cf1f254547b8b0e54e Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 19 Dec 2024 18:44:02 +0800 Subject: [PATCH] :bug: Document cannot be exported as Markdown https://github.com/siyuan-note/siyuan/issues/13545 --- kernel/model/export.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/kernel/model/export.go b/kernel/model/export.go index 4c6c33bf3..fa833b352 100644 --- a/kernel/model/export.go +++ b/kernel/model/export.go @@ -1473,11 +1473,6 @@ func ExportNotebookMarkdown(boxID string) (zipPath string) { docFiles := box.ListFiles("/") var docPaths []string for _, docFile := range docFiles { - id := strings.TrimSuffix(path.Base(docFile.path), ".sy") - if !ast.IsNodeIDPattern(id) { - continue - } - docPaths = append(docPaths, docFile.path) } @@ -3108,11 +3103,11 @@ func prepareExportTrees(docPaths []string) (defBlockIDs []string, trees *map[str treeCache := &map[string]*parse.Tree{} defBlockIDs = []string{} for _, p := range docPaths { - if strings.HasSuffix(p, ".sy") { + id := strings.TrimSuffix(path.Base(p), ".sy") + if !ast.IsNodeIDPattern(id) { continue } - id := util.GetTreeID(p) tree, err := loadTreeWithCache(id, treeCache) if err != nil { continue