diff --git a/kernel/go.sum b/kernel/go.sum index 89b4d1471..a74c42693 100644 --- a/kernel/go.sum +++ b/kernel/go.sum @@ -604,4 +604,3 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= - \ No newline at end of file diff --git a/kernel/model/search.go b/kernel/model/search.go index a879b7026..ba8c9a905 100644 --- a/kernel/model/search.go +++ b/kernel/model/search.go @@ -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