14

In my comment here:

https://stackoverflow.com/questions/409/what-is-your-favorite-coding-guidelines-checklist/138993#comment-8835926

I needed to have a : symbol with a leading space, but I couldn't figure out how to get it. And for some reason it converts differently in this question to how it would in a comment - as you can see, in the comment box ` :` wasn't turned into code block at all. Is it impossible, by design, to have leading or trailing space in a codeblock?

  • testing ` :` 123 ``` :``` – wim Sep 7 '11 at 1:55
  • Very interesting. – Matthew Read Sep 7 '11 at 2:00
  • 1
    Comments use a different Markdown "mini" parser, which explains how there's a difference, but I can't imagine this is by design. It actually causes an obscure bug in chat as well, since the client-side Markdown mini parser converts it as expected, only to have the server-side parser switch it back to its raw-text form. – Tim Stone Sep 7 '11 at 2:03
  • Oh, interesting. : and ` :`... Seems that only the leading space case doesn't work - the former works as expected. – Nightfirecat Sep 7 '11 at 3:37
  • testing ` untrimmed` trimmed – genesis Sep 7 '11 at 12:22
  • Thanks for the heads up. Closed as not constructive. Snake! – Won't Sep 7 '11 at 14:16
7

Citing Jeff's first comment to this answer about inline code in comments:

Spaces are not allowed as the start or end character in inline code blocks now. Do not include them, or it won't work.

That said, as a workaround you can put a zero-width unicode character '‍' (yeah, it's right there between the apostrophes) at the start of your inline code; then you can put a space after that character. Note, however, that what looks like a zero-width character to you may appear to be some odd character to them. Moreover, if people copy-and-paste that code from your comment, they may catch the zero-width character without noticing.

So in your case, putting `‍ :` in the comment should work (tested below).

  • To demonstrate that it works: ‍ : – Hendrik Vogt Sep 7 '11 at 12:47
  • 16
    And then people copy-past zero-width characters in their code and wonder why it doesn't work... – Cœur Feb 17 '18 at 2:18

You must log in to answer this question.

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