🐛 Non-desktop ends cannot export Markdown https://github.com/siyuan-note/siyuan/issues/11953

This commit is contained in:
Daniel 2024-07-13 22:00:51 +08:00
parent 5921ab900d
commit 1a881e35f7
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

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