This question has a block of code containing a string like "\foo\".

The syntax highlighting (reasonably enough) assumes the \" is an escaped double-quote and continues the highlighting for string for the remainder of the code block.

I've tried multiple backslashes, and this prevents the second slash from escaping the quote, but also shows both slashes!

How can this be improved upon?

dim someVar as Variant

someVar = "\foo\" & thisShouldNotBeStringHighlighted
someVar = "\foo\\" & tooManySlashes
  • Ah, I've just seen this about Google Prettify and how it's not StackExchange's tool.
    – LondonRob
    Commented May 31, 2017 at 11:30


You must log in to answer this question.

Browse other questions tagged .