mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 04:31:50 +08:00
🎨 Ctrl+N should follow notebook create save path https://ld246.com/article/1695965429553
This commit is contained in:
parent
41e35ea795
commit
2b9bec8e8b
@ -503,7 +503,7 @@ func createDocWithMd(c *gin.Context) {
|
|||||||
hPath = "/" + hPath
|
hPath = "/" + hPath
|
||||||
}
|
}
|
||||||
|
|
||||||
err := model.CreateWithMarkdown(notebook, hPath, markdown, parentID, id)
|
id, err := model.CreateWithMarkdown(notebook, hPath, markdown, parentID, id)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
ret.Code = -1
|
ret.Code = -1
|
||||||
ret.Msg = err.Error()
|
ret.Msg = err.Error()
|
||||||
|
@ -1028,7 +1028,7 @@ func CreateDocByMd(boxID, p, title, md string, sorts []string) (tree *parse.Tree
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateWithMarkdown(boxID, hPath, md, parentID, id string) (err error) {
|
func CreateWithMarkdown(boxID, hPath, md, parentID, id string) (retID string, err error) {
|
||||||
box := Conf.Box(boxID)
|
box := Conf.Box(boxID)
|
||||||
if nil == box {
|
if nil == box {
|
||||||
err = errors.New(Conf.Language(0))
|
err = errors.New(Conf.Language(0))
|
||||||
@ -1038,7 +1038,7 @@ func CreateWithMarkdown(boxID, hPath, md, parentID, id string) (err error) {
|
|||||||
WaitForWritingFiles()
|
WaitForWritingFiles()
|
||||||
luteEngine := util.NewLute()
|
luteEngine := util.NewLute()
|
||||||
dom := luteEngine.Md2BlockDOM(md, false)
|
dom := luteEngine.Md2BlockDOM(md, false)
|
||||||
_, _, err = createDocsByHPath(box.ID, hPath, dom, parentID, id)
|
retID, _, err = createDocsByHPath(box.ID, hPath, dom, parentID, id)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user