mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 06:11:53 +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
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
retID = ast.NewNodeID()
|
||||||
if "" == id {
|
if "" == id {
|
||||||
id = ast.NewNodeID()
|
id = retID
|
||||||
retID = id
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,10 +95,12 @@ func createDocsByHPath(boxID, hPath, content, parentID, id string /* id 参数
|
|||||||
root = hpathBtMap[hp]
|
root = hpathBtMap[hp]
|
||||||
isNotLast := i < len(parts)-1
|
isNotLast := i < len(parts)-1
|
||||||
if nil == root {
|
if nil == root {
|
||||||
if "" == retID {
|
rootID := ast.NewNodeID()
|
||||||
retID = ast.NewNodeID()
|
if i == len(parts)-1 {
|
||||||
|
rootID = retID
|
||||||
}
|
}
|
||||||
pathBuilder.WriteString(retID)
|
|
||||||
|
pathBuilder.WriteString(rootID)
|
||||||
docP := pathBuilder.String() + ".sy"
|
docP := pathBuilder.String() + ".sy"
|
||||||
if isNotLast {
|
if isNotLast {
|
||||||
if _, err = createDoc(boxID, docP, part, ""); nil != err {
|
if _, err = createDoc(boxID, docP, part, ""); nil != err {
|
||||||
@ -118,9 +120,6 @@ func createDocsByHPath(boxID, hPath, content, parentID, id string /* id 参数
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if "" == retID {
|
|
||||||
retID = root.ID
|
|
||||||
}
|
|
||||||
pathBuilder.WriteString(root.ID)
|
pathBuilder.WriteString(root.ID)
|
||||||
if !isNotLast {
|
if !isNotLast {
|
||||||
pathBuilder.WriteString(".sy")
|
pathBuilder.WriteString(".sy")
|
||||||
|
Loading…
Reference in New Issue
Block a user