Skip to content

Commit

Permalink
🎨 Database-bound block primary key supports setting static anchor text
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Dec 24, 2024
1 parent 9850b20 commit 914c765
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions kernel/model/attribute_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
}
Expand Down

0 comments on commit 914c765

Please sign in to comment.