4

In a comment on this question I couldn't figure out how to write a single backslash in code formatting: \. Is there a way?

3
  • 1
    \ You can quote the backslash in triple backticks.
    – khelwood
    Jan 15, 2021 at 0:26
  • I was gonna ask how you managed to do it in your question here then, but I guess this is one of those cases where we use different markdown parsing rules in comments for some reason. Jan 15, 2021 at 0:28
  • See this comment in the Formatting Sandbox: SOBotics Tool to get the source text of this comment. Single backslash and single backtick: \, `. Type: ``\``, `\``. Sep 6, 2021 at 7:39

1 Answer 1

10

You can write this in a comment:

``\``

and it will appear as a code-formatted backslash. I thought it required three backticks each side, but apparently two is the minimum.

4
  • Ah, the old triple backslash. Why didn't I think of that. \ Are you able to explain why it works? Jan 15, 2021 at 0:32
  • Only that comments support a different subset of markdown from questions and answers, and with single backticks the backslash can be interpreted as escaping the backtick.
    – khelwood
    Jan 15, 2021 at 0:36
  • I mean though, why three backticks exactly? Jan 15, 2021 at 2:16
  • @SteveBennett could have been worse if they kept in line with the 6 to 8 meme ...
    – rene
    Jan 15, 2021 at 6:53

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