Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2026-01-25 17:53:35 +08:00
parent d7e5ade487
commit 0be193eee6
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -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)