mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 19:59:08 +08:00
🎨 Workspace built-in Pandoc is no longer initialized after customizing Pandoc path https://github.com/siyuan-note/siyuan/issues/8377
This commit is contained in:
parent
b39742f494
commit
78f2601471
@ -87,6 +87,24 @@ func initPandoc() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pandocDir := filepath.Join(TempDir, "pandoc")
|
pandocDir := filepath.Join(TempDir, "pandoc")
|
||||||
|
|
||||||
|
if confPath := filepath.Join(ConfDir, "conf.json"); gulu.File.IsExist(confPath) {
|
||||||
|
// Workspace built-in Pandoc is no longer initialized after customizing Pandoc path https://github.com/siyuan-note/siyuan/issues/8377
|
||||||
|
if data, err := os.ReadFile(confPath); nil == err {
|
||||||
|
conf := map[string]interface{}{}
|
||||||
|
if err = gulu.JSON.UnmarshalJSON(data, &conf); nil == err && nil != conf["export"] {
|
||||||
|
export := conf["export"].(map[string]interface{})
|
||||||
|
if customPandocBinPath := export["pandocBin"].(string); !strings.HasPrefix(customPandocBinPath, pandocDir) {
|
||||||
|
if pandocVer := getPandocVer(customPandocBinPath); "" != pandocVer {
|
||||||
|
PandocBinPath = customPandocBinPath
|
||||||
|
logging.LogInfof("custom pandoc [ver=%s, bin=%s]", pandocVer, PandocBinPath)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if gulu.OS.IsWindows() {
|
if gulu.OS.IsWindows() {
|
||||||
PandocBinPath = filepath.Join(pandocDir, "bin", "pandoc.exe")
|
PandocBinPath = filepath.Join(pandocDir, "bin", "pandoc.exe")
|
||||||
} else if gulu.OS.IsDarwin() || gulu.OS.IsLinux() {
|
} else if gulu.OS.IsDarwin() || gulu.OS.IsLinux() {
|
||||||
|
Loading…
Reference in New Issue
Block a user