🎨 Use ID when block ref anchor text is empty https://github.com/siyuan-note/siyuan/issues/13606
This commit is contained in:
parent
929d079bc3
commit
e4fb91d56f
2 changed files with 5 additions and 2 deletions
|
@ -354,7 +354,7 @@ func RenderTemplate(p, id string, preview bool) (tree *parse.Tree, dom string, e
|
|||
// 块引缺失锚文本情况下自动补全 https://github.com/siyuan-note/siyuan/issues/6087
|
||||
if n.IsTextMarkType("block-ref") {
|
||||
if refText := n.Text(); "" == refText {
|
||||
refText = sql.GetRefText(n.TextMarkBlockRefID)
|
||||
refText = strings.TrimSpace(sql.GetRefText(n.TextMarkBlockRefID))
|
||||
if "" != refText {
|
||||
treenode.SetDynamicBlockRefText(n, refText)
|
||||
} else {
|
||||
|
|
|
@ -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})
|
||||
|
|
Loading…
Add table
Reference in a new issue