🎨 Improve link dest https://github.com/siyuan-note/siyuan/issues/13497
This commit is contained in:
parent
3bd2debf4c
commit
f3853ee842
1 changed files with 3 additions and 3 deletions
|
@ -592,7 +592,7 @@ func FindReplace(keyword, replacement string, replaceTypes map[string]bool, ids
|
|||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
replaceNodeTokens(n, method, keyword, replacement, r)
|
||||
replaceNodeTokens(n, method, keyword, strings.TrimSpace(replacement), r)
|
||||
case ast.NodeLinkText:
|
||||
if !replaceTypes["imgText"] {
|
||||
return ast.WalkContinue
|
||||
|
@ -673,11 +673,11 @@ func FindReplace(keyword, replacement string, replaceTypes map[string]bool, ids
|
|||
if replaceTypes["aHref"] {
|
||||
if 0 == method {
|
||||
if strings.Contains(n.TextMarkAHref, keyword) {
|
||||
n.TextMarkAHref = strings.ReplaceAll(n.TextMarkAHref, keyword, replacement)
|
||||
n.TextMarkAHref = strings.ReplaceAll(n.TextMarkAHref, keyword, strings.TrimSpace(replacement))
|
||||
}
|
||||
} else if 3 == method {
|
||||
if nil != r && r.MatchString(n.TextMarkAHref) {
|
||||
n.TextMarkAHref = r.ReplaceAllString(n.TextMarkAHref, replacement)
|
||||
n.TextMarkAHref = r.ReplaceAllString(n.TextMarkAHref, strings.TrimSpace(replacement))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue