mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 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:
parent
35ca2be3b5
commit
e321c639a7
2 changed files with 8 additions and 23 deletions
|
|
@ -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]
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue