highlight.js icon indicating copy to clipboard operation
highlight.js copied to clipboard

SQL language detection breaks if you use a < or > character in an if statement

Open jasongisstl opened this issue 9 years ago • 4 comments

If you have a less than or greater than character in an if statement, SQL language detection will fail.

E.g: hljs.highlightAuto("if 5 < 10", ["sql"]);

Returns text with no language highlighting, as "<" is detected as an 'illegal lexeme'.

jasongisstl avatar Jan 23 '17 15:01 jasongisstl

For Microsoft SQL Server's Transact-SQL (T-SQL), this issue is fixed in https://github.com/isagalaev/highlight.js/pull/1524

DavidSimner avatar May 18 '17 10:05 DavidSimner

Now works for PostgreSQL (#1804). As for pure standard SQL, if is not a valid statement anyway.

egor-rogov avatar Aug 31 '18 23:08 egor-rogov

Sounds like we could close this one then? @egor-rogov

joshgoebel avatar Oct 04 '19 19:10 joshgoebel

I guess so.

egor-rogov avatar Oct 05 '19 22:10 egor-rogov