-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix highlighting in database debug toolbar #5129
Conversation
Added a commit implementing replacement using regexp with word boundaries, to avoid overlaps / false positives with strings such as "OR", "IN"… |
d2aa2df
to
0db484e
Compare
356f723
to
4c49b17
Compare
Can you add before/after schreenshots? |
I confirmed the fix, but if ever you want screenshots of this toolbar content, you may have a look at #5136. |
There is unfortunately none of the key words changed here visible in the other PR. Would be great to see just one example what has been fixed in this PR, too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this PR addresses an error in highlighting multiple-word identifiers, please add before/after screenshots, as @sfadschm suggested, that show there are indeed problems with the current and how this PR fixes them.
Maybe we should add the ASC and DESC keywords? |
Also, I'd suggest either highlighting commas in addition to parentheses, or not highlighting parentheses. Your pick? |
I think adding the keywords would be good, but would rather remove the parentheses. But lets wait for other calls. |
I would like removing parentheses, adding ASC and DESC. |
Let's highlight only keywords, leaving out parentheses and other punctuation marks. |
The word boundaries were not working with them. Also, this change makes the preg_quote() superfluous.
As discussed, it's better to highlight the keywords only.
eaba3f7
to
1fa0f25
Compare
|
Thank you, @vlakoff |
Highlighting wasn't working for multiple-word terms, as they were searched in the SQL string with nbsp entities instead of regular spaces.
This code could be optimized, though it's not crucial as it's a debug function.