Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2026-01-23 18:46:09 +08:00
parent c516e38007
commit fb5d170df2
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 97 additions and 20 deletions

View file

@ -773,7 +773,6 @@ func ExportDocx(id, savePath string, removeAssets, merge bool) (fullPath string,
"-f", "html+tex_math_dollars",
"--resource-path", tmpDir,
"-o", tmpDocxPath,
"--lua-filter", util.PandocColorFilterPath,
}
params := util.RemoveInvalid(Conf.Export.PandocParams)
@ -786,6 +785,17 @@ func ExportDocx(id, savePath string, removeAssets, merge bool) (fullPath string,
}
}
hasLuaFilter := false
for i := 0; i < len(args)-1; i++ {
if "--lua-filter" == args[i] {
hasLuaFilter = true
break
}
}
if !hasLuaFilter {
args = append(args, "--lua-filter", util.PandocColorFilterPath)
}
pandoc := exec.Command(Conf.Export.PandocBin, args...)
gulu.CmdAttr(pandoc)
pandoc.Stdin = bytes.NewBufferString(content)