markRegExp highlight individual groups?
See original GitHub issueHi!
Sorry to bother, but is it possible to highlight individual groups in a regular expression?
I am trying to make a custom HTML/custom syntax highlighter, and it seems, that the whole regex is highlighted. There is a parameter named ignoreGroups
, but it does not help much, since there are also groups after the needed keyword.
Example text: Hello world [%test:value%]
Regex: /(\[%)([a-z_]+):(.+?)(%])/g
As you can see in the example above, it’s hard to separately highlight the value
and the %]
part.
Maybe it is possible to make a separateGroups
parameter, so that each
callback will receive each group? Thanks in advance!
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
mark.js – JavaScript keyword highlight
js is a text highlighter written in JavaScript. It can be used to dynamically mark search terms or custom regular expressions and offers...
Read more >How to highlight positive or negative numbers with mark.js ...
1 Answer 1 ... Also, you should group (non-capture) the '.###' part as a whole and put the ? for that group instead,...
Read more >Versatile Keyword Highlighting Plugin For jQuery - mark.js
Supports regular expressions, diacritics, synonyms, custom class names, separate word search (multiple terms), filter selectors, word boundary ...
Read more >Easy JavaScript Plugin For Word Highlighting In The Document
mark.js is a lightweight and easy-to-use JavaScript library used for highlighting specified words/strings/phrases in the selected element.
Read more >mark.js - Bountysource
Mark.js will not highlight within an iframe, unless the context also ... Text doesn't get marked when it contains parentheses () using markRegExp...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@evheny0 It’s on the master branch, actually. But, it’s not released yet. I just haven’t had time to take over the development again. However, maybe I’ll have the time in the next couple of weeks to release a new major version.
@Mottie Since this feature is coming from your end #183 could you please have a look at the issue mentioned from @danny0838?