From 457f94159fb299ca403ab8bd6b05a6beafcb5e75 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 13 Jul 2024 22:00:51 +0800 Subject: [PATCH] :bug: Non-desktop ends cannot export Markdown https://github.com/siyuan-note/siyuan/issues/11953 --- kernel/util/pandoc.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/util/pandoc.go b/kernel/util/pandoc.go index 090a4dddbc9..164ca054ac0 100644 --- a/kernel/util/pandoc.go +++ b/kernel/util/pandoc.go @@ -58,11 +58,6 @@ func ConvertPandoc(dir string, args ...string) (path string, err error) { } func Pandoc(from, to, o, content string) (err error) { - if "" == PandocBinPath || ContainerStd != Container { - err = ErrPandocNotFound - return - } - if "" == from || "" == to || "md" == to { if err = gulu.File.WriteFileSafer(o, []byte(content), 0644); nil != err { logging.LogErrorf("write export markdown file [%s] failed: %s", o, err) @@ -70,6 +65,11 @@ func Pandoc(from, to, o, content string) (err error) { return } + if "" == PandocBinPath || ContainerStd != Container { + err = ErrPandocNotFound + return + } + dir := filepath.Join(WorkspaceDir, "temp", "convert", "pandoc", gulu.Rand.String(7)) if err = os.MkdirAll(dir, 0755); nil != err { logging.LogErrorf("mkdir [%s] failed: [%s]", dir, err)