diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index 4d11aa7ab..476e88d55 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -574,8 +574,11 @@ function replaceNodeTextFn( let sedCount = extraArgs.sedCount || 0; const handleNode = node => { const before = node.textContent; - if ( safe.RegExp_test.call(rePattern, before) === false ) { return true; } + reCondition.lastIndex = 0; if ( safe.RegExp_test.call(reCondition, before) === false ) { return true; } + rePattern.lastIndex = 0; + if ( safe.RegExp_test.call(rePattern, before) === false ) { return true; } + rePattern.lastIndex = 0; const after = pattern !== '' ? before.replace(rePattern, replacement) : replacement;