react-highlight-words icon indicating copy to clipboard operation
react-highlight-words copied to clipboard

Passing additional information to findChunks

Open mgoldenbe opened this issue 1 year ago • 1 comments

I am highlighting matching terms in lines of text. For my layout, each line needs to be rendered separately, so I have one <Highlighter> per line. Furthermore, I need to highlight a term even if it spans more than a single line. To do this, I need to pass the previous and the next line as additional context for findChunks to work with. How can this be achieved?

mgoldenbe avatar Jan 17 '24 15:01 mgoldenbe

<Highlighter findChunks={(...args) => customFindChunk(...args, additionalContext)}/>

sergei-startsev avatar Jan 17 '24 15:01 sergei-startsev