fix: search for duplicate keyword boundary error #528

This commit is contained in:
Hufe921
2024-04-27 12:01:27 +08:00
parent f41cea2443
commit d4c6cd25f6
+1 -1
View File
@@ -222,7 +222,7 @@ export class Search {
let index = text.indexOf(payload) let index = text.indexOf(payload)
while (index !== -1) { while (index !== -1) {
matchStartIndexList.push(index) matchStartIndexList.push(index)
index = text.indexOf(payload, index + 1) index = text.indexOf(payload, index + payload.length)
} }
for (let m = 0; m < matchStartIndexList.length; m++) { for (let m = 0; m < matchStartIndexList.length; m++) {
const startIndex = matchStartIndexList[m] const startIndex = matchStartIndexList[m]