I recently posted a comment where I wanted to present =\ inside backquotes. However, the backslash escapes the final backquote (which makes some sense). I tried using double backslashes, but this still didn't get the effect I wanted. How do I put a backslash inside backquotes? (Or is this a bug in the comment parser?)
1 Answer
Use double backticks like this:
``=\``
Why?
In standard Markdown syntax, you include a literal backtick inside a code span by using multiple backticks to delimit the span, e.g.
``There is a literal backtick (`) here.``
produces
There is a literal backtick (`) here.
This doesn't work, however, for strings that begin or end with a literal backtick. To include a literal backtick at the beginning or end of a code span in standard Markdown, you need to separate the double backticks from the string with a space, e.g.
`` CREATE TABLE `foo` ``
produces
CREATE TABLE `foo`
Comments only support a subset of Markdown, though, and the additional space in the delimiter is not supported. Instead, Stack Exchange's Markdown parser allows you to escape a single backtick in a code span inside a comment by using a backslash, e.g.
`There is a literal backtick (\`) here.`
This means that you can't end the string with a backslash, or you will be escaping the closing backtick in the code span, e.g.
`C:\`
in a comment produces
`C:`
If the delimiter is a pair of backticks, on the other hand, the backslash no longer acts as an escape, so you can put it at the end of the code span:
``C:\``
=\
(space after\
)=\
is an operator in and of itself. Since you want to assign a lambda expression to the name add, you need a space:= \
"