@@ -714,7 +714,8 @@ function replaceNodeTextFn(
714714 const reNodeName = safe . patternToRegex ( nodeName , 'i' , true ) ;
715715 const rePattern = safe . patternToRegex ( pattern , 'gms' ) ;
716716 const extraArgs = safe . getExtraArgs ( Array . from ( arguments ) , 3 ) ;
717- const reCondition = safe . patternToRegex ( extraArgs . condition || '' , 'ms' ) ;
717+ const reIncludes = safe . patternToRegex ( extraArgs . includes || extraArgs . condition || '' , 'ms' ) ;
718+ const reExcludes = safe . patternToRegex ( extraArgs . excludes || '' , 'ms' ) ;
718719 const stop = ( takeRecord = true ) => {
719720 if ( takeRecord ) {
720721 handleMutations ( observer . takeRecords ( ) ) ;
@@ -727,8 +728,10 @@ function replaceNodeTextFn(
727728 let sedCount = extraArgs . sedCount || 0 ;
728729 const handleNode = node => {
729730 const before = node . textContent ;
730- reCondition . lastIndex = 0 ;
731- if ( safe . RegExp_test . call ( reCondition , before ) === false ) { return true ; }
731+ reIncludes . lastIndex = 0 ;
732+ if ( safe . RegExp_test . call ( reIncludes , before ) === false ) { return true ; }
733+ reExcludes . lastIndex = 0 ;
734+ if ( safe . RegExp_test . call ( reExcludes , before ) ) { return true ; }
732735 rePattern . lastIndex = 0 ;
733736 if ( safe . RegExp_test . call ( rePattern , before ) === false ) { return true ; }
734737 rePattern . lastIndex = 0 ;
0 commit comments