mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 Database-bound block primary key supports setting static anchor text https://github.com/siyuan-note/siyuan/issues/10049
This commit is contained in:
parent
6f443be578
commit
077a46ac70
1 changed files with 3 additions and 3 deletions
|
|
@ -3112,7 +3112,7 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID string, valueDa
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
updateBlockValueStaticText(node, tree, avID, strings.TrimSpace(val.Block.Content))
|
updateBlockValueStaticText(tx, node, tree, avID, strings.TrimSpace(val.Block.Content))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3281,12 +3281,12 @@ func bindBlockAv0(tx *Transaction, avID string, node *ast.Node, tree *parse.Tree
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateBlockValueStaticText(node *ast.Node, tree *parse.Tree, avID, text string) {
|
func updateBlockValueStaticText(tx *Transaction, node *ast.Node, tree *parse.Tree, avID, text string) {
|
||||||
attrs := parse.IAL2Map(node.KramdownIAL)
|
attrs := parse.IAL2Map(node.KramdownIAL)
|
||||||
attrs[av.NodeAttrViewStaticText+"-"+avID] = text
|
attrs[av.NodeAttrViewStaticText+"-"+avID] = text
|
||||||
var err error
|
var err error
|
||||||
if nil != tree {
|
if nil != tree {
|
||||||
err = setNodeAttrsWithTx(nil, node, tree, attrs)
|
err = setNodeAttrsWithTx(tx, node, tree, attrs)
|
||||||
} else {
|
} else {
|
||||||
err = setNodeAttrs(node, nil, attrs)
|
err = setNodeAttrs(node, nil, attrs)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue