lumin
lumin copied to clipboard
Is it possible to add a start and end index?
[question] [feature-request]
I am working on a search in a table, so if there is "Luminosity" in the table and someone searched for "minos", only that part should be highlighted. Is it possible with lumin? This can be done if we have a start and end index that can be provided.
Lumin does not support this at the moment. For you use case, https://markjs.io/ may be a better option
Leaving this open as a feature request. Something to keep in mind that lumin works on complex nodes. For example:
<div id="luminRoot">
These are my fav things:
<ul>
<li>Raindrops on roses</li>
<li>whiskers on
<a href="...">kittens</a>
</li>
</ul>
and more...
</div>
What does start and end offset mean in this case?
@pshihn probably the most clear meaning would be : start a position of the first character to highlight and end is a position of the last character to highlight in a tree nodes. So in the example you provided if I pass a prop start=0 and end=30 then the lumin should highlight characters starting from "T" to "r" in raindrops
@szholdiyarov What do you mean by "raindrops'?
The issue pointed out in the above example is the difficulty in highlighting text across nodes at different levels.