🎨 Use ID when block ref anchor text is empty https://github.com/siyuan-note/siyuan/issues/13606

This commit is contained in:
Daniel 2024-12-25 17:38:54 +08:00
parent 929d079bc3
commit e4fb91d56f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 5 additions and 2 deletions

View file

@ -1619,7 +1619,10 @@ func updateRefText(refNode *ast.Node, changedDefNodes map[string]*ast.Node) (cha
changed = true
if "d" == subtype {
refText = getNodeRefText(defNode)
refText = strings.TrimSpace(getNodeRefText(defNode))
if "" == refText {
refText = n.TextMarkBlockRefID
}
treenode.SetDynamicBlockRefText(n, refText)
}
defNodes = append(defNodes, &changedDefNode{id: defID, refText: refText, refType: "ref-" + subtype})