Browse Source

fix: loop reset nextStart

hudahai 2 years ago
parent
commit
62e59837c6
1 changed files with 1 additions and 0 deletions
  1. 1 0
      core/stringx/replacer.go

+ 1 - 0
core/stringx/replacer.go

@@ -40,6 +40,7 @@ func (r *replacer) Replace(text string) string {
 			replaced := r.mapping[string(target[:used])]
 			target = append([]rune(replaced), target[used:]...)
 			cur = r.node
+			nextStart = 0
 		} else {
 			buf.WriteString(string(target[:used]))
 			target = target[used:]