Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing additional information to findChunks #115

Open
mgoldenbe opened this issue Jan 17, 2024 · 1 comment
Open

Passing additional information to findChunks #115

mgoldenbe opened this issue Jan 17, 2024 · 1 comment

Comments

@mgoldenbe
Copy link

mgoldenbe commented Jan 17, 2024

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?

@sergei-startsev
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants