mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🐛 The save path is incorrect when creating a sub-doc by ref in a doc with the same name Fix https://github.com/siyuan-note/siyuan/issues/8138
This commit is contained in:
parent
c7875757c0
commit
f3dd8e5315
4 changed files with 60 additions and 5 deletions
|
|
@ -967,7 +967,7 @@ func CreateDocByMd(boxID, p, title, md string, sorts []string) (tree *parse.Tree
|
|||
return
|
||||
}
|
||||
|
||||
func CreateWithMarkdown(boxID, hPath, md string) (id string, err error) {
|
||||
func CreateWithMarkdown(boxID, hPath, md, parentID string) (id string, err error) {
|
||||
box := Conf.Box(boxID)
|
||||
if nil == box {
|
||||
err = errors.New(Conf.Language(0))
|
||||
|
|
@ -977,7 +977,7 @@ func CreateWithMarkdown(boxID, hPath, md string) (id string, err error) {
|
|||
WaitForWritingFiles()
|
||||
luteEngine := util.NewLute()
|
||||
dom := luteEngine.Md2BlockDOM(md, false)
|
||||
id, _, err = createDocsByHPath(box.ID, hPath, dom)
|
||||
id, _, err = createDocsByHPath(box.ID, hPath, dom, parentID)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -1380,7 +1380,7 @@ func CreateDailyNote(boxID string) (p string, existed bool, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
id, existed, err := createDocsByHPath(box.ID, hPath, "")
|
||||
id, existed, err := createDocsByHPath(box.ID, hPath, "", "")
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue