sql-highlight
sql-highlight copied to clipboard
Bug in beta tokenizer
Just looking at the code I think there is a bug here:
https://github.com/scriptcoded/sql-highlight/blob/909c361424255f5af2a5e87b96dcd9e93e61123d/lib/index.js#L42C21-L42C21
This only matches litteral periods .. I assume that you meant to match any character /(?<unknown>.+?)/.
Without this change (now that it's using .matchAll()) anything in the input SQL string that does not match the regex will be removed from the results and not visible to the user. I assume that is undesired.
(Also of note that this approach will at most match a single character in every unknown group match.)
And a bit off topic, but I'm using this highlighter with a non-standard SQL flavor, which uses several additional keywords. These keywords will now be highlighted as identifiers. I hope the highlighting for those is not too disturbing. 😅
This issue has been marked as stale because it has been open for 14 days with no activity. Remove the stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
As good a time as any to give some form of response at least. Simply put I haven't had that much time the last few weeks due to various reasons. But next week is vacation, maybe I'll have some time then :smile: No promises though
And a bit off topic, but I'm using this highlighter with a non-standard SQL flavor, which uses several additional keywords. These keywords will now be highlighted as identifiers. I hope the highlighting for those is not too disturbing. 😅
Covered by #189
Woops, that does seem like a mistake, not sure why I put the backslash there. Or for that matter, the + sign.
I submitted #193, it simultaneously fixes this ticket (which is a regression from my #148) and fixes #150.
#193 is merged to beta and will be released soon. Closing this a bit prematurely. Feel free to reopen if you don't think it's fixed.
:tada: This issue has been resolved in version 6.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: