-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add possibility to define custom highlighter #6
Comments
This would absolutely be a useful feature to have. One major issue with the library at the moment is that it's using plain regex for highlighting. While this works fine in most cases, more complex queries and language features might not be properly highlighted, and even break the highlighter as a whole. I think a general improvement for this library would be to look in to alternative methods for matching language features, and perhaps then this would make more sense. I think this feature was to be implemented right now we would also have to provide some way of choosing what position in As for this specific case, perhaps the rule is something that should be put into the base library? |
@scriptcoded yeah, I understand the difficulty with where you execute custom regex. Maybe it can be set with some kind of an option (order):
Previously, I was using igniculus and this idea (and other my issues) come from there. Custom rules section there also has a warning mark as an experimental advanced feature. As per my case, I was using this regex to highlight query duration |
@vladshcherbin I like the idea of using |
Closed in #57! 馃帀 Docs: https://github.com/scriptcoded/sql-highlight#custom-highlighting |
馃憢
Hey, in a similar library I've used a feature where you could define your custom highlighter with regex and color, something like this:
It gives possibility to color custom parts of query, for example if it includes query duration.
Would be nice to have something similar here later if possible :)
The text was updated successfully, but these errors were encountered: