2

StackOverflow engine treats backslash character \ as an escape symbol for string literals.
But backslash is NOT an escape symbol in SQL.
So, simple statement select '\' from dual produces incorrect syntax highlighting.

Example of real SQL code with wrong highlighting

Please fix the problem.

0

1 Answer 1

5

Stack Overflow doesn't have a syntax highlighting engine; it uses Google Prettify.

In order to change the current behaviour you can either raise an issue or submit a fix yourself. Stack Overflow's syntax highlighter will then be automatically updated when the latest version of Prettify is pulled.

Having said that even with an explicit language hint (<!-- language: lang-sql -->) a \ is normally not used as an escape, though it is not rendered as a string literal.

select '\' 

To take a portion of your example (this is quite difficult to see on my screen) it's still almost working

select ('^(.*?)(<.*?>)$', '\'||pos), blah

It's only the addition of more single quotes that causes it to break

select ('^(.*?)(<.*?>)$', '\'||pos)
  'blah' blah
2
  • Thank you for your answer and explanations about Google Prettify. I have noticed that SQLFiddle has the same problem, probably because of the same reason. Unfortunately, <!-- language: lang-sql --> did not solve syntax highlighting problem in my code. Commented Feb 9, 2013 at 10:48
  • The hint is automatically added to the source already @Egor as the question is tagged oracle. Commented Feb 9, 2013 at 10:49

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.