I wanted to add to an answer that \ should be escaped but I didn't manage to put this in a comment.

When I did:


then it didn't display the \, and:


causes it to only display one \ without formatting.

I did not seem to be able to post \ or \\. Is this by design or not, and is there a way to actually write \ or \\ in a comment?

  • I also had problem but I think `\\` this works? - hmm half right That's 3 slashes in the backticks and shows only 2 with the ticks.. not formatted but at least 2 show ;) – clairesuzy May 21 '11 at 9:44
  • \ you mean? – Jeff Atwood May 21 '11 at 10:01
  • @JeffAtwood but without highlight.. – Kjuly Oct 12 '12 at 5:07

see Can we please have a place where changes to the markdown syntax are documented?

There is no escaping at all in multi-backtick code. Start a code block with five backticks, and everything will appear verbatim until we find another run of (precisely) five backticks.

thus you want


which will produce


and for the record this is the same as it works in regular Markdown.

| improve this answer | |

Edit: this is mainly an observation I discovered and is not an acceptable solution, it is million times inferior to the current accepted answer as you need sometimes escape and sometimes not, so it is not recommended

When the slash(es) inside backticks in comments (this doesn't happen in Qs or As) do not have anything after them, you need to escape them:

`\\` will display `\`
`\\\` will display `\\`

but if you have anything after, you do not need to escape:

`\\hi` will display `\\hi`
`\\\hi` will display `\\\hi`
| improve this answer | |
  • Nether \` nor \\` works.. – Kjuly Oct 12 '12 at 5:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .