# Multiple spaces not showing up in comment code-blocks

I wrote a solution to a code golf challenge that included the string ".... ....". This exact number of dots and spaces was necessary for the solution to work.

Two users commented (here, here) on ways to golf it down. I tested their suggestions and found that they didn't work. Initially I thought the users were confused; Then I tried to write a comment:

@User That doesn't work; Did you mean for the string to be ".... ...."?

And it rendered as:

@User That doesn't work; Did you mean for the string to be ".... ...."?

Is this intentional? If so, why? It has surely caused problems like this before. However, it looks like a bug to me. In posts, multiple spaces in backtick code blocks render as expected.

• I can reproduce this behavior in the formatting sandbox: meta.stackexchange.com/questions/3122/formatting-sandbox/… – James May 15 '17 at 19:20
• I can also find unexpected behaviour with the character counter: puu.sh/vR0qt/db6bb5a889.png – Okx May 15 '17 at 19:23
• This was fixed almost 8 years ago, but it seems to be back now. Since this seems to be a network wide problem, I have brought up the issue again here. – James May 15 '17 at 19:34
• I use non-breaking spaces to get around this issue when I must. – ETHproductions May 15 '17 at 19:40
• @ETHproductions Does&nbsp;that&nbsp;work&nbsp;in&nbsp;code&nbsp;blocks? – MD XF May 15 '17 at 19:41
• You can't use &nbsp;, you just have to copy-paste a raw non-breaking space from somewhere. I primarily use Windows, so I copy it from the Character Map program (it's the character after ~). Example: non-breaking    spaces   – ETHproductions May 15 '17 at 19:42
• @ETHproductions Wow,▓just▓found▓my▓new▓favorite▓pastime.░That's░awesome. – MD XF May 15 '17 at 19:43
• ....      .... alternating space and NBSP – Digital Trauma May 15 '17 at 21:01
• I'm reading this on the mobile app and the spaces in the code blocks in the question are being "collapsed" too. – Shaggy May 16 '17 at 20:30

## 1 Answer

As a workaround, you can make each character a different type of space; e.g. alternate normal and non-breaking spaces:

<space><nbsp><space><nbsp>...


@edit: As @ETHproductions points out, simply use all non-breaking space.

The wikipedia article lists several entry methods in various environments.

• ....      .... alternating space and NBSP – Digital Trauma May 15 '17 at 21:05
• – ETHproductions May 15 '17 at 21:05
• ....      .... All NBSP – Digital Trauma May 15 '17 at 21:06
• @ETHproductions fair enough. It didn't seem to work for me before when I tried, but now it looks good. – Digital Trauma May 15 '17 at 21:06
• Do we really need to use a workaround - couldn't we just get a bugfix? – MD XF May 15 '17 at 21:10
• @MDXF it's now been reported here: meta.stackexchange.com/q/296038/310400 – numbermaniac May 16 '17 at 7:04
• @numbermaniac Yeah, because DJMcMayhem posted that after reading this. – MD XF May 16 '17 at 16:22
• @MDXF, it's not really a bug: it's a design flaw in HTML. As such any "bug fix" implemented by the website is really a workaround rather than a bug fix. – Peter Taylor Jul 15 '17 at 6:54