highlight.js
highlight.js copied to clipboard
SQL language detection breaks if you use a < or > character in an if statement
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'.
For Microsoft SQL Server's Transact-SQL (T-SQL), this issue is fixed in https://github.com/isagalaev/highlight.js/pull/1524
Now works for PostgreSQL (#1804).
As for pure standard SQL, if is not a valid statement anyway.
Sounds like we could close this one then? @egor-rogov
I guess so.