This commit is contained in:
Liang Ding 2022-09-18 19:59:26 +08:00
parent db8ca05b27
commit edfb645f3a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 3 additions and 2 deletions

View file

@ -166,8 +166,10 @@ func FindReplace(keyword, replacement string, ids []string) (err error) {
n.Tokens = bytes.ReplaceAll(n.Tokens, []byte(keyword), []byte(replacement))
}
case ast.NodeTextMark:
if strings.Contains(n.TextMarkTextContent, keyword) {
if strings.Contains(n.TextMarkTextContent, keyword) || strings.Contains(n.TextMarkInlineMathContent, keyword) || strings.Contains(n.TextMarkInlineMemoContent, keyword) {
n.TextMarkTextContent = strings.ReplaceAll(n.TextMarkTextContent, keyword, replacement)
n.TextMarkInlineMathContent = strings.ReplaceAll(n.TextMarkInlineMathContent, keyword, replacement)
n.TextMarkInlineMemoContent = strings.ReplaceAll(n.TextMarkInlineMemoContent, keyword, replacement)
}
}
return ast.WalkContinue