Open jnachtigall opened 6 years ago
Bug fix PR would be welcome. 😄
What version are you using? This should have been fixed by https://github.com/bvaughn/highlight-words-core/pull/6 . I am not certain which versions of react-highlight-words
include that fix.
I am using Highlighter in a project where only the beginning of words should be hightlighted. The code is like this:
If the
${this.inputToHighlight = ''
(empty string) so that searchWords evaluates to\\b
then this results in an loop and eventally an time-out or out-of-memory.Other than in this edge case, it works to match word boundaries this way. I worked around the issue for now by using
Stack-Trace (from Firefox Console, but time-out also happens in Chrome and IE) is like:
I could setup something on glitch.com or codepen, but do not have much time at the moment, so hopefully this is enough to reproduce.