I'm trying to fix the following issue, as it's being very annoying on my site. https://code.google.com/p/google-code-prettify/issues/detail?id=341&thanks=341&ts=1398085413
and refers to the following file of the prettify code: https://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-sql.js?r=179
The issue is that
- When in SQL creating a string that ends with a "\", the highlighter thinks it is escaped, while this is not T-SQL syntax.
To reproduce, use this code as source code: (with Google Code Prettify installed)
<pre class="prettyprint lang-sql"> SELECT @BUPath = 'c:\backups\' + @DBName + '-B4 CHANGE.bak' SELECT @BUName = @DBName + '-B4 CHANGE' </pre>
I would expect the code to understand that the slash before the quote in the part 'c:\backups\' is not an escaping character...
I am expecting that this line would need to be changed, but I am not sure how:
[PR['PR_STRING'], /^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/, null,
'"\'']
fiddle showing the issue: http://jsfiddle.net/JH5uj/5/