geshi-1.0
geshi-1.0 copied to clipboard
SQL highlighting broken when string contains square brackets
When trying to highlight this as SQL:
'['+ABC+']'
I get wrong results.
Which SQL standard is this based on? What special syntax rule does it use?
https://www.w3schools.com/sql/func_sqlserver_concat_with_plus.asp https://docs.microsoft.com/de-de/sql/t-sql/language-elements/string-concatenation-transact-sql?view=sql-server-ver15
Microsoft SQL-Server, TSQL, Azure DataWarehouse, ...
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.
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...
Just using '['+ABC+']' works fine as well. I'm personally using version 1.0.8.9 of the sql file.
