What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

This question already has an answer here:

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.

share|improve this question

marked as duplicate by ben is uǝq backwards, Lucifer, wax eagle, Manishearth, Rory Jun 14 '13 at 14:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

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
share|improve this answer
    
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. –  Egor Skriptunoff Feb 9 '13 at 10:48
    
The hint is automatically added to the source already @Egor as the question is tagged oracle. –  ben is uǝq backwards Feb 9 '13 at 10:49

Not the answer you're looking for? Browse other questions tagged .