It's annoying that on stack overflow ` ` works fine in questions and answers but not in comments, to produce a single code-formatted space.

Edit a few days later

Actually my question appears to be a duplicate of Markdown in comments: Inline code section does not format correctly if it contains only white-space which is marked as a duplicate of My comment `code block` was not converted properly, is this a bug? which in turn cites a comment by Jeff which is apparently no longer visible in the thread at Recent change of inline code in comments leads to mistakes in old comments

The duplicate-spotting code didn't locate these initially but some of the people who edited my question and/or posted relevant answers managed to include enough material to make the duplicate-spotter suggest it in the right sidebar.

So now it's all as clear as mud to me.

  • Test: It's annoying that ` ` works fine in questions and answers but not in commas. – Mysticial Apr 5 '13 at 16:08
  • meta seems to behave differently - meta doesn't do code formatting? – drquicksilver Apr 5 '13 at 16:09
  • Yes it does. It should be the same as on SO. – Mysticial Apr 5 '13 at 16:09
  • stackoverflow.com/questions/15836321/… direct link (I hope) to the comment with the single spaces which don't work, the answer above has working ones. – drquicksilver Apr 5 '13 at 16:10
  • It works for me. Can someone please explain how to repro? – djechlin Apr 5 '13 at 16:12
  • IMO you should explicitly type out "space" to make your sentence easier to read, either in the answer or the comment. – Wooble Apr 5 '13 at 16:12
  • Test leading space ​ lead, test trailing space trail . Space . – nhahtdh Apr 5 '13 at 16:14
  • Perhaps. But code-formatted single characters are quite a natural way to discuss analysis of strings character by character and programming languages with special symbols. Anyone the point of my question is the difference between comment and Q&A, not the feature's existence at all. – drquicksilver Apr 5 '13 at 16:16

It is certainly annoying not being able to properly codify leading space, trailing space, repeating space, and space as the only character within backticks in comment.

It is possible to force codification when the text within backticks starts with spaces in comment, by putting an invisible leading character Zero-Width Space U+200B before the leading space. (No Break Space U+00A0 does not work here).

In post, the codification happens when there is leading space, but no leading space is preserved. To workaround, you only need to use No Break Space U+00A0 as the leading space.

It is possible to force retention of repeating spaces and trailing spaces (in both post and comment), by using No Break Space U+00A0.

  • As demo, ​ leading space, only space ​         , repeating        spaces with trailing spaces         . – nhahtdh Apr 5 '13 at 16:30
  • 2
    Thanks. Useful (but fiddly) workaround. Of course I understand that comments are intended to only support a subset of the markdown supported by the posts, but this particular difference just seems odd to me. – drquicksilver Apr 8 '13 at 12:54

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