This commit is contained in:
Liang Ding 2023-05-11 09:03:45 +08:00
parent a52cf1eb29
commit 847be4b939
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 40 additions and 5 deletions

View file

@ -26,7 +26,7 @@ import (
"github.com/siyuan-note/logging"
)
func Pandoc(from, to, content string) (ret string, err error) {
func Pandoc(from, to, o, content string) (ret string, err error) {
if "" == from || "" == to || "md" == to {
ret = content
return
@ -37,6 +37,10 @@ func Pandoc(from, to, content string) (ret string, err error) {
"--to", to,
}
if "" != o {
args = append(args, "-o", o)
}
pandoc := exec.Command(PandocBinPath, args...)
gulu.CmdAttr(pandoc)
pandoc.Stdin = bytes.NewBufferString(content)