mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
6b8bd6e8f2
3 changed files with 11 additions and 6 deletions
|
@ -3032,7 +3032,7 @@ func addAttributeViewBlock(now int64, avID, dbBlockID, groupID, previousItemID,
|
|||
|
||||
var blockIcon string
|
||||
if !isDetached {
|
||||
blockIcon, addingBlockContent = getNodeAvBlockText(node)
|
||||
blockIcon, addingBlockContent = getNodeAvBlockText(node, "")
|
||||
addingBlockContent = util.UnescapeHTML(addingBlockContent)
|
||||
}
|
||||
|
||||
|
@ -4278,7 +4278,7 @@ func replaceAttributeViewBlock0(attrView *av.AttributeView, oldBlockID, newBlock
|
|||
if !isDetached && blockVal.Block.ID == newBlockID && nil != node && nil != tree {
|
||||
bindBlockAv0(tx, avID, node, tree)
|
||||
blockVal.IsDetached = false
|
||||
icon, content := getNodeAvBlockText(node)
|
||||
icon, content := getNodeAvBlockText(node, "")
|
||||
content = util.UnescapeHTML(content)
|
||||
blockVal.Block.Icon, blockVal.Block.Content = icon, content
|
||||
blockVal.UpdatedAt = now
|
||||
|
@ -4302,7 +4302,7 @@ func replaceAttributeViewBlock0(attrView *av.AttributeView, oldBlockID, newBlock
|
|||
bindBlockAv(tx, avID, newBlockID)
|
||||
|
||||
blockVal.Block.ID = newBlockID
|
||||
icon, content := getNodeAvBlockText(node)
|
||||
icon, content := getNodeAvBlockText(node, "")
|
||||
content = util.UnescapeHTML(content)
|
||||
blockVal.Block.Icon, blockVal.Block.Content = icon, content
|
||||
|
||||
|
@ -4539,7 +4539,7 @@ func updateAttributeViewValue(tx *Transaction, attrView *av.AttributeView, keyID
|
|||
} else { // 之前绑定的块和现在绑定的块一样
|
||||
content := strings.TrimSpace(val.Block.Content)
|
||||
node, tree, _ := getNodeByBlockID(tx, val.Block.ID)
|
||||
_, blockText := getNodeAvBlockText(node)
|
||||
_, blockText := getNodeAvBlockText(node, "")
|
||||
if "" == content {
|
||||
// 使用动态锚文本
|
||||
val.Block.Content = util.UnescapeHTML(blockText)
|
||||
|
|
|
@ -288,7 +288,7 @@ func getNodeRefText(node *ast.Node) string {
|
|||
return getNodeRefText0(node, Conf.Editor.BlockRefDynamicAnchorTextMaxLen, true)
|
||||
}
|
||||
|
||||
func getNodeAvBlockText(node *ast.Node) (icon, content string) {
|
||||
func getNodeAvBlockText(node *ast.Node, avID string) (icon, content string) {
|
||||
if nil == node {
|
||||
return
|
||||
}
|
||||
|
@ -303,6 +303,11 @@ func getNodeAvBlockText(node *ast.Node) (icon, content string) {
|
|||
}
|
||||
|
||||
content = strings.TrimSpace(content)
|
||||
if "" != avID {
|
||||
if staticText := node.IALAttr(av.NodeAttrViewStaticText + "-" + avID); "" != staticText {
|
||||
content = staticText
|
||||
}
|
||||
}
|
||||
if "" == content {
|
||||
content = Conf.language(105)
|
||||
}
|
||||
|
|
|
@ -310,7 +310,7 @@ func updateAttributeViewBlockText(updatedDefNodes map[string]*ast.Node) {
|
|||
|
||||
for _, blockValue := range blockValues.Values {
|
||||
if blockValue.Block.ID == updatedDefNode.ID {
|
||||
newIcon, newContent := getNodeAvBlockText(updatedDefNode)
|
||||
newIcon, newContent := getNodeAvBlockText(updatedDefNode, avID)
|
||||
if newIcon != blockValue.Block.Icon {
|
||||
blockValue.Block.Icon = newIcon
|
||||
changedAv = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue