mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 06:49:50 +08:00
🎨 Improve kernel stability https://github.com/siyuan-note/siyuan/issues/9912
This commit is contained in:
parent
4e8d045452
commit
ad6edcae03
@ -52,9 +52,9 @@ func createDocsByHPath(boxID, hPath, content, parentID, id string /* id 参数
|
||||
return
|
||||
}
|
||||
} else {
|
||||
retID = ast.NewNodeID()
|
||||
if "" == id {
|
||||
id = ast.NewNodeID()
|
||||
retID = id
|
||||
id = retID
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,10 +95,12 @@ func createDocsByHPath(boxID, hPath, content, parentID, id string /* id 参数
|
||||
root = hpathBtMap[hp]
|
||||
isNotLast := i < len(parts)-1
|
||||
if nil == root {
|
||||
if "" == retID {
|
||||
retID = ast.NewNodeID()
|
||||
rootID := ast.NewNodeID()
|
||||
if i == len(parts)-1 {
|
||||
rootID = retID
|
||||
}
|
||||
pathBuilder.WriteString(retID)
|
||||
|
||||
pathBuilder.WriteString(rootID)
|
||||
docP := pathBuilder.String() + ".sy"
|
||||
if isNotLast {
|
||||
if _, err = createDoc(boxID, docP, part, ""); nil != err {
|
||||
@ -118,9 +120,6 @@ func createDocsByHPath(boxID, hPath, content, parentID, id string /* id 参数
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if "" == retID {
|
||||
retID = root.ID
|
||||
}
|
||||
pathBuilder.WriteString(root.ID)
|
||||
if !isNotLast {
|
||||
pathBuilder.WriteString(".sy")
|
||||
|
Loading…
Reference in New Issue
Block a user