🎨 Update the parent_id of blocks below a heading block when updating the heading block https://github.com/siyuan-note/siyuan/issues/14871

This commit is contained in:
Daniel 2025-05-24 11:58:56 +08:00
parent 35ca2be3b5
commit e321c639a7
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 8 additions and 23 deletions

View file

@ -44,9 +44,14 @@ func NodeHash(node *ast.Node, tree *parse.Tree, luteEngine *lute.Lute) string {
}
hpath := tree.HPath
data := tree.Box + tree.Path + hpath + string(ial) + md
var parentID string
if nil != node.Parent {
data += node.Parent.ID
parentID = node.Parent.ID
}
if h := HeadingParent(node); nil != h {
parentID = h.ID
}
data += parentID
return fmt.Sprintf("%x", sha256.Sum256(gulu.Str.ToBytes(data)))[:7]
}