mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-02 21:51:49 +01:00
🎨 Improve export to Word .docx format https://github.com/siyuan-note/siyuan/issues/14970
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
c516e38007
commit
fb5d170df2
2 changed files with 97 additions and 20 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue