mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 When New document save location is configured as ../, it will be completed as ../Untitled Fix https://github.com/siyuan-note/siyuan/issues/8238
This commit is contained in:
parent
0bfc2b5c64
commit
182f767469
4 changed files with 23 additions and 0 deletions
|
|
@ -528,6 +528,14 @@ func getDocCreateSavePath(c *gin.Context) {
|
|||
if "" == docCreateSavePathTpl {
|
||||
docCreateSavePathTpl = model.Conf.FileTree.DocCreateSavePath
|
||||
}
|
||||
docCreateSavePathTpl = strings.TrimSpace(docCreateSavePathTpl)
|
||||
if "../" == docCreateSavePathTpl {
|
||||
docCreateSavePathTpl = "../Untitled"
|
||||
}
|
||||
for strings.HasSuffix(docCreateSavePathTpl, "/") {
|
||||
docCreateSavePathTpl = strings.TrimSuffix(docCreateSavePathTpl, "/")
|
||||
docCreateSavePathTpl = strings.TrimSpace(docCreateSavePathTpl)
|
||||
}
|
||||
|
||||
p, err := model.RenderGoTemplate(docCreateSavePathTpl)
|
||||
if nil != err {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue