🐛 Document duplicated when creating by block reference Fix https://github.com/siyuan-note/siyuan/issues/8981

This commit is contained in:
Daniel 2023-08-16 11:34:37 +08:00
parent a516f8da2c
commit dd7679eac6
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -112,6 +112,7 @@ func GetBlockTreeRootByPath(boxID, path string) (ret *BlockTree) {
}
func GetBlockTreeRootByHPath(boxID, hPath string) (ret *BlockTree) {
hPath = gulu.Str.RemoveInvisible(hPath)
blockTrees.Range(func(key, value interface{}) bool {
slice := value.(*btSlice)
slice.m.Lock()
@ -128,6 +129,7 @@ func GetBlockTreeRootByHPath(boxID, hPath string) (ret *BlockTree) {
}
func GetBlockTreeRootByHPathPreferredParentID(boxID, hPath, preferredParentID string) (ret *BlockTree) {
hPath = gulu.Str.RemoveInvisible(hPath)
var roots []*BlockTree
blockTrees.Range(func(key, value interface{}) bool {
slice := value.(*btSlice)