Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Database-bound block primary key supports setting static anchor text https://github.com/siyuan-note/siyuan/issues/10049

Daniel914c7659388e
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index b61bd6f529..28015ed627 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -3108,12 +3108,22 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID string, valueDa
} else { // 之前绑定的块和现在绑定的块一样
content := strings.TrimSpace(val.Block.Content)
node, tree, _ := getNodeByBlockID(tx, val.BlockID)
+ updateStaticText := true
+ _, blockText := getNodeAvBlockText(node)
if "" == content {
- _, val.Block.Content = getNodeAvBlockText(node)
+ val.Block.Content = blockText
+ } else {
+ if blockText == content {
+ updateStaticText = false
+ } else {
+ val.Block.Content = blockText
+ }
}
- // 设置静态锚文本 Database-bound block primary key supports setting static anchor text https://github.com/siyuan-note/siyuan/issues/10049
- updateBlockValueStaticText(tx, node, tree, avID, content)
+ if updateStaticText {
+ // 设置静态锚文本 Database-bound block primary key supports setting static anchor text https://github.com/siyuan-note/siyuan/issues/10049
+ updateBlockValueStaticText(tx, node, tree, avID, content)
+ }
}
}
}