mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 15:28:49 +01:00
🐛 偶发编辑文档标题后引用处的动态锚文本不更新 Fix https://github.com/siyuan-note/siyuan/issues/5891
This commit is contained in:
parent
a8560b365b
commit
5861be23ee
3 changed files with 18 additions and 4 deletions
|
|
@ -886,11 +886,19 @@ func (tx *Transaction) doUpdate(operation *Operation) (ret *TxErr) {
|
|||
if "" == strings.TrimSpace(n.TextMarkInlineMathContent) {
|
||||
unlinks = append(unlinks, n)
|
||||
}
|
||||
} else if n.IsTextMarkType("block-ref") {
|
||||
sql.CacheRef(subTree, n)
|
||||
|
||||
if "d" == n.TextMarkBlockRefSubtype {
|
||||
// 偶发编辑文档标题后引用处的动态锚文本不更新 https://github.com/siyuan-note/siyuan/issues/5891
|
||||
// 使用缓存的动态锚文本强制覆盖当前块中的引用节点动态锚文本
|
||||
if dRefText, ok := treenode.DynamicRefTexts.Load(n.TextMarkBlockRefID); ok && "" != dRefText {
|
||||
n.TextMarkTextContent = dRefText.(string)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ast.NodeBlockRef == n.Type {
|
||||
sql.CacheRef(subTree, n)
|
||||
} else if ast.NodeTextMark == n.Type && n.IsTextMarkType("block-ref") {
|
||||
sql.CacheRef(subTree, n)
|
||||
}
|
||||
return ast.WalkContinue
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue