Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/14970#issuecomment-3796317161

Daniel0be193eee6fd
diff --git a/kernel/model/export.go b/kernel/model/export.go
index 7d2cc21536..4f7b8b8ece 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -796,6 +796,17 @@ func ExportDocx(id, savePath string, removeAssets, merge bool) (fullPath string,
args = append(args, "--lua-filter", util.PandocColorFilterPath)
}
+ hasReferenceDoc := false
+ for i := 0; i < len(args)-1; i++ {
+ if "--reference-doc" == args[i] {
+ hasReferenceDoc = true
+ break
+ }
+ }
+ if !hasReferenceDoc {
+ args = append(args, "--reference-doc", util.PandocTemplatePath)
+ }
+
pandoc := exec.Command(Conf.Export.PandocBin, args...)
gulu.CmdAttr(pandoc)
pandoc.Stdin = bytes.NewBufferString(content)