rubychan / coderay

Fast and easy syntax highlighting for selected languages, written in Ruby.
http://coderay.rubychan.de/
Other
846 stars 115 forks source link

Bug in SQL parser #163

Closed thegoatherder closed 10 years ago

thegoatherder commented 10 years ago

The following code tagged with the SQL class:

SELECT RIGHT( SUSER_NAME(),LEN( SUSER_NAME())-CHARINDEX('\', SUSER_NAME()))

OUTPUTS:

SELECT RIGHT( SUSER_NAME(),LEN( SUSER_NAME())-CHARINDEX('\'

It appears that the \' escapes the rest of the string. If I add a space after the slash then it renders correctly (but my SQL code is then incorrect!

SELECT RIGHT( SUSER_NAME(),LEN( SUSER_NAME())-CHARINDEX('\ ', SUSER_NAME()))
korny commented 10 years ago

Thank you, that was a pretty stupid bug :)