mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 Improve av https://github.com/siyuan-note/siyuan/issues/15508
This commit is contained in:
parent
9df352efdb
commit
35813e4b2a
1 changed files with 1 additions and 9 deletions
|
|
@ -4227,20 +4227,12 @@ func updateAttributeViewValue(tx *Transaction, attrView *av.AttributeView, keyID
|
||||||
} else { // 之前绑定的块和现在绑定的块一样
|
} else { // 之前绑定的块和现在绑定的块一样
|
||||||
content := strings.TrimSpace(val.Block.Content)
|
content := strings.TrimSpace(val.Block.Content)
|
||||||
node, tree, _ := getNodeByBlockID(tx, val.BlockID)
|
node, tree, _ := getNodeByBlockID(tx, val.BlockID)
|
||||||
updateStaticText := true
|
|
||||||
_, blockText := getNodeAvBlockText(node)
|
_, blockText := getNodeAvBlockText(node)
|
||||||
if "" == content {
|
if "" == content {
|
||||||
// 使用动态锚文本
|
// 使用动态锚文本
|
||||||
val.Block.Content = util.UnescapeHTML(blockText)
|
val.Block.Content = util.UnescapeHTML(blockText)
|
||||||
} else {
|
|
||||||
if blockText == content {
|
|
||||||
updateStaticText = false
|
|
||||||
} else {
|
} else {
|
||||||
val.Block.Content = content
|
val.Block.Content = content
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if updateStaticText {
|
|
||||||
// 设置静态锚文本 Database-bound block primary key supports setting static anchor text https://github.com/siyuan-note/siyuan/issues/10049
|
// 设置静态锚文本 Database-bound block primary key supports setting static anchor text https://github.com/siyuan-note/siyuan/issues/10049
|
||||||
updateBlockValueStaticText(tx, node, tree, avID, content)
|
updateBlockValueStaticText(tx, node, tree, avID, content)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue