StackExchange.DataExplorer icon indicating copy to clipboard operation
StackExchange.DataExplorer copied to clipboard

fixes the TSQL string escape parsing inside codemirror sql.js

Open rschrieken opened this issue 4 years ago • 3 comments

a ' doesn't escape a ' in a T-SQL string, a double quote does. So the codemirror highlighting needs to honor that.

This fixes https://meta.stackexchange.com/questions/350640/backslash-before-single-quote-breaks-syntax-highlighting-the-quote-is-not-escap

rschrieken avatar Sep 05 '20 13:09 rschrieken

Is this fixed in a newer CodeMirror release by chance? This is the the thing of thing we should upstream lest is be nuked by an update.

NickCraver avatar Sep 21 '20 23:09 NickCraver

This is a custom highlighter that does some SEDE-specific stuff on top of TSQL, but there might be a better way of doing it now that would allow taking upstream improvements too?

tms avatar Sep 22 '20 02:09 tms

I checked the current version of that function which I believe is found here: https://github.com/codemirror/CodeMirror/blob/3bf49684d4c62965c1257421c2fe8593f7660d59/mode/sql/sql.js#L133 and that won't fix that bug. Inspecting the codemirror.next doesn't tell me if this gets fixed but I would need to grab these bits and then test to verify.

rschrieken avatar Sep 22 '20 21:09 rschrieken