File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,6 @@ const DIACRITICS_EXCEPTION = new Set([
7777let DIACRITICS_EXCEPTION_STR ; // Lazily initialized, see below.
7878
7979const DIACRITICS_REG_EXP = / \p{ M} + / gu;
80- const SPECIAL_PUNCTUATION_CHARACTERS = / [ . ? * { } ( ) [ \] \\ ] / g;
8180const SPECIAL_CHARS_REG_EXP = / ( [ + ^ $ | ] ) | ( \p{ P} + ) | ( \s + ) | ( \p{ M} ) | ( \p{ L} ) / gu;
8281const NOT_DIACRITIC_FROM_END_REG_EXP = / ( [ ^ \p{ M} ] ) \p{ M} * $ / u;
8382const NOT_DIACRITIC_FROM_START_REG_EXP = / ^ \p{ M} * ( [ ^ \p{ M} ] ) / u;
@@ -735,14 +734,11 @@ class PDFFindController {
735734
736735 if ( p1 ) {
737736 // Escape characters like *+?... to not interfere with regexp syntax.
738- return addExtraWhitespaces ( p1 , `\\ ${ p1 } ` ) ;
737+ return addExtraWhitespaces ( p1 , RegExp . escape ( p1 ) ) ;
739738 }
740739 if ( p2 ) {
741740 // Allow whitespaces around group of punctuation signs.
742- return addExtraWhitespaces (
743- p2 ,
744- p2 . replaceAll ( SPECIAL_PUNCTUATION_CHARACTERS , "\\$&" )
745- ) ;
741+ return addExtraWhitespaces ( p2 , RegExp . escape ( p2 ) ) ;
746742 }
747743 if ( p3 ) {
748744 // Replace spaces by \s+ to be sure to match any spaces.
You can’t perform that action at this time.
0 commit comments