Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: exportMdContent missing footnotes https://github.com/siyuan-note/siyuan/pull/16953

Daniel3f3db3c34f9b
diff --git a/kernel/model/export.go b/kernel/model/export.go
index a8d28b3683..9929efacb8 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -3069,10 +3069,16 @@ func resolveFootnotesDefs(refFootnotes *[]*refAsFootnotes, currentTree *parse.Tr
for _, foot := range *refFootnotes {
t, err := loadTreeWithCache(foot.defID, treeCache)
if nil != err {
- return
+ logging.LogWarnf("load tree for footnote def [%s] refNum [%s] failed: %s", foot.defID, foot.refNum, err)
+ continue
}
defNode := treenode.GetNodeInTree(t, foot.defID)
+ if nil == defNode {
+ logging.LogErrorf("not found node [%s] in tree for footnote refNum [%s]", foot.defID, foot.refNum)
+ continue
+ }
+
docID := util.GetTreeID(defNode.Path)
var nodes []*ast.Node
if ast.NodeHeading == defNode.Type {