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

Be able to determine how many times a search term has appeared in filter when using acrossElements

Open rbhalla opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. Currently if you match a term using acrossElements: true, every mark in every element increments the counters provided in filter. If you want to (for example) only mark the first instance of that term, you don't have a counter for that.

Describe the solution you'd like A separate counter to track how many times a single match has been marked.

Describe a potential solution approach Described above.

Additional context Here is an example of the problem: https://jsfiddle.net/xtdchk1a/1/

If you look at the console, every call to filter increments all counters. Ideally you would have a counter that is 0 when it runs the first two times, and 1 when it runs the second two times.

rbhalla avatar Jul 15 '22 21:07 rbhalla

It's possible this is actually a bug and this counter is meant to exist: https://github.com/julmot/mark.js/issues/468

rbhalla avatar Jul 15 '22 21:07 rbhalla

+1 I opened #468 for similar reasons. It was closed due to inactivity.

hovavo avatar Jul 27 '22 10:07 hovavo

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 31 '22 01:08 stale[bot]