This commit is contained in:
Daniel 2024-05-17 21:50:35 +08:00
parent b670cdb29a
commit ad58e1c0c9
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -803,7 +803,7 @@ func replaceTextNode(text *ast.Node, method int, keyword string, replacement str
}
} else if 3 == method {
if nil != r && r.MatchString(string(text.Tokens)) {
newContent := bytes.ReplaceAll(text.Tokens, []byte(keyword), []byte(replacement))
newContent := []byte(r.ReplaceAllString(string(text.Tokens), replacement))
tree := parse.Inline("", newContent, luteEngine.ParseOptions)
if nil == tree.Root.FirstChild {
return false