Skip to content
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

SQL highlighting broken when string contains square brackets #95

Open
rgpublic opened this issue Nov 29, 2017 · 5 comments
Open

SQL highlighting broken when string contains square brackets #95

rgpublic opened this issue Nov 29, 2017 · 5 comments

Comments

@rgpublic
Copy link

When trying to highlight this as SQL:

'['+ABC+']'

I get wrong results.

@BenBE
Copy link
Contributor

BenBE commented Mar 8, 2020

Which SQL standard is this based on? What special syntax rule does it use?

@Streusel
Copy link
Contributor

Streusel commented Mar 31, 2020

Can you provide a full example where it doesn't work? @rgpublic
SELECT * FROM `CONFINE` WHERE `PRI` = $1 GROUP BY '[' + HEX + ']'
properly defines & marks the brackets as a string in my version.

@rgpublic
Copy link
Author

rgpublic commented Mar 31, 2020

Does ist also work for you with
'['+ABC+']'
@Streusel ?
Yes, I know it's not a full example. But: I came here because the GeSHi highlighter is used in Drupal's "Geshi Filter for syntax highlighting" module:

https://www.drupal.org/project/geshifilter

This module is used on a site we're taking care of for a blog about programming issues to format code excerpts. Sometimes, there's only a short code excerpt discussed. It's not always a full executable MySQL statement. But shouldn't the above thing be formatted right anyway? It works if there is not a square bracket within the quotes. Doesn't make that much sense to me...

@Streusel
Copy link
Contributor

Just using '['+ABC+']' works fine as well. I'm personally using version 1.0.8.9 of the sql file.
Screen Shot 2020-03-31 at 3 40 42 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants