* Escapes special regex characters in a string.
(str: string)
| 829 | * Escapes special regex characters in a string. |
| 830 | */ |
| 831 | function escapeRegex(str: string): string { |
| 832 | return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') |
| 833 | } |
| 834 | |
| 835 | /** |
| 836 | * Applies search highlighting to already syntax-highlighted HTML. |
no test coverage detected