lumin icon indicating copy to clipboard operation
lumin copied to clipboard

Is it possible to add a start and end index?

Open sabithpocker opened this issue 6 years ago • 4 comments

[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.

sabithpocker avatar Jun 11 '18 16:06 sabithpocker

Lumin does not support this at the moment. For you use case, https://markjs.io/ may be a better option

pshihn avatar Jun 11 '18 17:06 pshihn

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 avatar Jun 11 '18 17:06 pshihn

@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 avatar Oct 19 '18 13:10 szholdiyarov

@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.

sabithpocker avatar Oct 25 '18 14:10 sabithpocker