mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Trim space in dialynote/block ref/new doc save path https://github.com/siyuan-note/siyuan/issues/14482
This commit is contained in:
parent
54c25af19f
commit
4c080e2b34
3 changed files with 15 additions and 6 deletions
|
|
@ -361,14 +361,14 @@ func setNotebookConf(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
boxConf.RefCreateSavePath = strings.TrimSpace(boxConf.RefCreateSavePath)
|
||||
boxConf.RefCreateSavePath = util.TrimSpaceInPath(boxConf.RefCreateSavePath)
|
||||
if "" != boxConf.RefCreateSavePath {
|
||||
if !strings.HasSuffix(boxConf.RefCreateSavePath, "/") {
|
||||
boxConf.RefCreateSavePath += "/"
|
||||
}
|
||||
}
|
||||
|
||||
boxConf.DailyNoteSavePath = strings.TrimSpace(boxConf.DailyNoteSavePath)
|
||||
boxConf.DailyNoteSavePath = util.TrimSpaceInPath(boxConf.DailyNoteSavePath)
|
||||
if "" != boxConf.DailyNoteSavePath {
|
||||
if !strings.HasPrefix(boxConf.DailyNoteSavePath, "/") {
|
||||
boxConf.DailyNoteSavePath = "/" + boxConf.DailyNoteSavePath
|
||||
|
|
@ -380,7 +380,7 @@ func setNotebookConf(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
boxConf.DailyNoteTemplatePath = strings.TrimSpace(boxConf.DailyNoteTemplatePath)
|
||||
boxConf.DailyNoteTemplatePath = util.TrimSpaceInPath(boxConf.DailyNoteTemplatePath)
|
||||
if "" != boxConf.DailyNoteTemplatePath {
|
||||
if !strings.HasSuffix(boxConf.DailyNoteTemplatePath, ".md") {
|
||||
boxConf.DailyNoteTemplatePath += ".md"
|
||||
|
|
@ -390,7 +390,7 @@ func setNotebookConf(c *gin.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
boxConf.DocCreateSavePath = strings.TrimSpace(boxConf.DocCreateSavePath)
|
||||
boxConf.DocCreateSavePath = util.TrimSpaceInPath(boxConf.DocCreateSavePath)
|
||||
|
||||
box.SaveConf(boxConf)
|
||||
ret.Data = boxConf
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue