react-highlight-words
react-highlight-words copied to clipboard
React component to highlight words within a larger body of text
I am highlighting matching terms in lines of text. For my layout, each line needs to be rendered separately, so I have one `` per line. Furthermore, I need to...
# Summary This pull request revises Highlighter.js by substituting the outdated [substr](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) method with [substring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring). - [substr](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) is no longer recommended and may have been removed from relevant web standards....
When `autoEscape` is set to true and (at least) one of the elements in `searchWords` array is regex, the following exception is raised: ``` TypeError str.replace is not a function...
The demo website was crashing when you typed _[_ into **Search terms** box. Had a discussion with [bvaughn](https://github.com/bvaughn) about setting the **autoEscape** param to **true** on highlight-words-core package, but as...
memoize-one and prop-types where included into final bundle
`dist/main.js` is 57 KB: https://unpkg.com/[email protected]/dist/. Looking at the JS file, it appears to have chunks of React init (eg. PropTypes): https://unpkg.com/[email protected]/dist/main.js If I use your code from Git rather than...
autoEscape: Escape characters in searchWords which are meaningful in regular expressions. However, when input ‘***x’, the component crashes.
The text I'm passing to the textToHighlight prop contains newlines because it is formatted in paragraphs. Unfortunately, the spacing or newlines are not maintained so my text doesn't look formatted...
See this example: https://codesandbox.io/s/7j2njo9l2q. ```js searchWords={["e"]} textToHighlight="sleep" activeIndex={0} ``` highlights both `ee` instead of just the first `e`. With `activeIndex={1}` nothing gets highlighted.
I am using Highlighter in a project where only the beginning of words should be hightlighted. The code is like this: ```js ``` If the `${this.inputToHighlight = ''` (empty string)...