Skip to content

Commit 76d9e88

Browse files
Merge pull request #1 from tompuric/patch-1
Update index.js
2 parents 01d4b9e + 5d0f434 commit 76d9e88

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const findWithRegex = (regex, contentBlock, callback) => {
55
let start; // eslint-disable-line
66
// Go through all matches in the text and return the indizes to the callback
77
while ((matchArr = regex.exec(text)) !== null) { // eslint-disable-line
8+
if (matchArr.index === regex.lastIndex) {
9+
regex.lastIndex++;
10+
}
811
start = matchArr.index;
912
callback(start, start + matchArr[0].length);
1013
}

0 commit comments

Comments
 (0)