Skip to content

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

:art: Improve exporting Markdown https://github.com/siyuan-note/siyuan/issues/13273

Daniel483faa93dd86
diff --git a/kernel/model/export.go b/kernel/model/export.go
index 47369a89e6..127e2ab1f3 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -1985,6 +1985,9 @@ func exportMarkdownContent0(tree *parse.Tree, cloudAssetsBase string, assetsDest
if "d" != bt.Type {
href += "#" + defID
}
+ if tree.ID == bt.RootID {
+ href = "#" + defID
+ }
}
href = strings.TrimPrefix(href, currentDocDir)
href = util.FilterFilePath(href)