When highlighting a span that includes an existing highlight, duplicate text is inserted
Closed this issue · 5 comments
Looks like this is due to (partial) duplicate annotations existing. I can fix that by deduplicating them, but can't actually get it to change within the widget because Streamlit won't let me update the widget's value dynamically.
Hi, sorry about that, I may have been unclear.
In your example, if you highlight "Hello world!" at the start (so that it overlaps the "Hello" highlight, it will create duplicate text, which is my problem.
Ah, thank you for the clarification. It is resolved in the latest version of text-highlighter (pip install --upgrade text-highlighter
).
In version 0.0.7 of text highlighter, one or multiple overlapping highlights will be deselected. This overcomes the issue with duplicated text and also works in scenarios for more than two overlapping highlights.
That's great, thank you! Really appreciate the fast response.