5

Consider the following text:

Location: \192.168.22.1\documentation

You'll notice the above only has a single backward slash before the IP address. Here's how the exact same text looks when I put it in a code block:

Location: \\192.168.22.1\documentation

For some reason the first line truncates one of the leading backward slashes while the 2nd does not.

You can see this behavior displayed on this question. It ended up not being relevant to the guy's problem, but this could easily cause some confusion.

I've checked the Markdown Editing help page and don't see this being a result of some formatting rule.

Is this a bug?

  • 2
    I don't think it is a bug. It is a necessary feature for things like this Lots of [[[]]] (Source: [Lots of \[\[\[\]\]\]](http://meta.stackexchange.com/questions/197721/double-forward-slash-truncating)) – nhahtdh Sep 20 '13 at 20:18
  • 4
    those are backslashes – Brad Mace Sep 20 '13 at 20:21
  • @BradMace D'oh! Thanks – tnw Sep 20 '13 at 20:22
  • @nhahtdh I don't really understand what your example is demonstrating – tnw Sep 20 '13 at 20:23
  • @tnw: Linking something with lots of [] inside. \ is necessary for escaping purpose. – nhahtdh Sep 20 '13 at 20:25
  • 2
    It’s for escaping. \ is a pretty common escape character, and it’s the one used in Markdown (for example \*asterisk’d\* will render surrounded by asterisks, not italicized). Code blocks disable Markdown. – Ry- Sep 20 '13 at 20:26
  • @minitech That makes sense. I guess it's interpreted as escaping the `` so we only see one. If any of you guys want to add that as an answer I'll accept it. – tnw Sep 20 '13 at 20:29
  • @tnw: … aaand it also escapes ` in comments. Sort of :D Use two backticks for that one (though I can’t type it here) – Ry- Sep 20 '13 at 20:29
9

It’s for escaping. \ is a pretty common escape character, and it’s the one used in Markdown (for example, \*asterisk’d\* will render surrounded by asterisks, not italicized). Code blocks disable Markdown.

It also escapes itself, as all good escape characters should. Compare:

\\example

\example

\\\\example

\\example

You must log in to answer this question.

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