🎨 Improve database block content escaping https://github.com/siyuan-note/siyuan/issues/14781

This commit is contained in:
Daniel 2025-05-08 12:28:09 +08:00
parent 74c66129f2
commit 3b3dedefdb
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 6 additions and 3 deletions

View file

@ -2903,7 +2903,9 @@ func replaceAttributeViewBlock(operation *Operation, tx *Transaction) (err error
if !operation.IsDetached {
bindBlockAv0(tx, operation.AvID, node, tree)
value.IsDetached = false
value.Block.Icon, value.Block.Content = getNodeAvBlockText(node)
icon, content := getNodeAvBlockText(node)
content = util.UnescapeHTML(content)
value.Block.Icon, value.Block.Content = icon, content
value.UpdatedAt = now
err = av.SaveAttributeView(attrView)
}
@ -2940,7 +2942,9 @@ func replaceAttributeViewBlock(operation *Operation, tx *Transaction) (err error
value.Block.ID = operation.NextID
value.IsDetached = operation.IsDetached
if !operation.IsDetached {
value.Block.Icon, value.Block.Content = getNodeAvBlockText(node)
icon, content := getNodeAvBlockText(node)
content = util.UnescapeHTML(content)
value.Block.Icon, value.Block.Content = icon, content
}
}