🐛 引用命名块时动态锚文本没有使用命名 Fix https://github.com/siyuan-note/siyuan/issues/6032
This commit is contained in:
parent
3555df9267
commit
801e5d12e1
1 changed files with 3 additions and 6 deletions
|
@ -24,7 +24,6 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute/ast"
|
||||
|
@ -1131,11 +1130,9 @@ func updateRefText(refNode *ast.Node, changedDefNodes map[string]*ast.Node) (cha
|
|||
if ast.NodeDocument != defNode.Type && defNode.IsContainerBlock() {
|
||||
defNode = treenode.FirstLeafBlock(defNode)
|
||||
}
|
||||
defContent := renderBlockText(defNode)
|
||||
if Conf.Editor.BlockRefDynamicAnchorTextMaxLen < utf8.RuneCountInString(defContent) {
|
||||
defContent = gulu.Str.SubStr(defContent, Conf.Editor.BlockRefDynamicAnchorTextMaxLen) + "..."
|
||||
}
|
||||
treenode.SetDynamicBlockRefText(n, defContent)
|
||||
|
||||
refText := getNodeRefText(defNode)
|
||||
treenode.SetDynamicBlockRefText(n, refText)
|
||||
changed = true
|
||||
return ast.WalkContinue
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue