sandbox.js icon indicating copy to clipboard operation
sandbox.js copied to clipboard

added option for prefix only highlighting

Open mscolnick opened this issue 10 years ago • 5 comments

mscolnick avatar Jul 09 '15 21:07 mscolnick

I'm sorry, don't know where to write... We can to show words which not match/not found?

andrew-y0u avatar Apr 22 '16 14:04 andrew-y0u

@andrew-y0u Can you please explain what you mean and what your use case is?

julkue avatar Apr 22 '16 14:04 julkue

@julmot I have a list of words. I need highlight this words in text and I need displaying words which not found.

Example: array of words which need to find: ['word1', 'word2', 'word3']; text where I must find: "lorem ipsum word1 lorem word2";

I must highlight 'word1' and 'word2', and pass 'word3' to new array with words which not found, so then I can display not found words.

andrew-y0u avatar Apr 22 '16 14:04 andrew-y0u

@andrew-y0u I'm giving you an example with mark.js:

https://jsfiddle.net/julmot/qp44591x/

If you want you can open a feature request to implement an option for this.

julkue avatar Apr 22 '16 15:04 julkue

@andrew-y0u Good news! I just released v6.1.0 of mark.js containing a new callback option noMatch, which will receive not found terms. This solves your issue.

julkue avatar May 15 '16 19:05 julkue