You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your great package, really neat stuff.
I was fiddling with a custom RegexHighlighter and noticed that it only highlights the patterns enclosed in named groups.
I was wondering if there is interest in allowing regex highlighting of unnamed patterns?
This would be useful if a user wants to match multiple patterns to the same style.
I could not find an example on how to do that in the docs so I worked around this.
This behavior results from the following line on the Text class within text.py:
for name in match.groupdict().keys():
A simple workaround is to check for groupdict() first and in case there is none append only the style preffix to the matched span.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
Thank you for your great package, really neat stuff.
I was fiddling with a custom RegexHighlighter and noticed that it only highlights the patterns enclosed in named groups.
I was wondering if there is interest in allowing regex highlighting of unnamed patterns?
This would be useful if a user wants to match multiple patterns to the same style.
I could not find an example on how to do that in the docs so I worked around this.
This behavior results from the following line on the Text class within text.py:
for name in match.groupdict().keys():
A simple workaround is to check for groupdict() first and in case there is none append only the style preffix to the matched span.
Keep up the good work.
Cheers,
Igor
Beta Was this translation helpful? Give feedback.
All reactions