4
\$\begingroup\$

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.

\$\endgroup\$
10
  • 1
    \$\begingroup\$ I can reproduce this behavior in the formatting sandbox: meta.stackexchange.com/questions/3122/formatting-sandbox/… \$\endgroup\$
    – DJMcMayhem
    Commented May 15, 2017 at 19:20
  • 1
    \$\begingroup\$ I can also find unexpected behaviour with the character counter: puu.sh/vR0qt/db6bb5a889.png \$\endgroup\$
    – Okx
    Commented May 15, 2017 at 19:23
  • 2
    \$\begingroup\$ 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. \$\endgroup\$
    – DJMcMayhem
    Commented May 15, 2017 at 19:34
  • 1
    \$\begingroup\$ I use non-breaking spaces to get around this issue when I must. \$\endgroup\$ Commented May 15, 2017 at 19:40
  • \$\begingroup\$ @ETHproductions Does that work in code blocks? \$\endgroup\$
    – MD XF
    Commented May 15, 2017 at 19:41
  • \$\begingroup\$ You can't use  , 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   \$\endgroup\$ Commented May 15, 2017 at 19:42
  • \$\begingroup\$ @ETHproductions Wow,▓just▓found▓my▓new▓favorite▓pastime.░That's░awesome. \$\endgroup\$
    – MD XF
    Commented May 15, 2017 at 19:43
  • \$\begingroup\$ ....      .... alternating space and NBSP \$\endgroup\$ Commented May 15, 2017 at 21:01
  • 1
    \$\begingroup\$ I'm reading this on the mobile app and the spaces in the code blocks in the question are being "collapsed" too. \$\endgroup\$
    – Shaggy
    Commented May 16, 2017 at 20:30
  • \$\begingroup\$ This appears to be status completed now \$\endgroup\$ Commented Jun 2, 2021 at 17:17

1 Answer 1

2
\$\begingroup\$

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.

\$\endgroup\$
8
  • \$\begingroup\$ ....      .... alternating space and NBSP \$\endgroup\$ Commented May 15, 2017 at 21:05
  • \$\begingroup\$ Or just use all NBSP's \$\endgroup\$ Commented May 15, 2017 at 21:05
  • \$\begingroup\$ ....      .... All NBSP \$\endgroup\$ Commented May 15, 2017 at 21:06
  • \$\begingroup\$ @ETHproductions fair enough. It didn't seem to work for me before when I tried, but now it looks good. \$\endgroup\$ Commented May 15, 2017 at 21:06
  • 1
    \$\begingroup\$ Do we really need to use a workaround - couldn't we just get a bugfix? \$\endgroup\$
    – MD XF
    Commented May 15, 2017 at 21:10
  • \$\begingroup\$ @MDXF it's now been reported here: meta.stackexchange.com/q/296038/310400 \$\endgroup\$ Commented May 16, 2017 at 7:04
  • \$\begingroup\$ @numbermaniac Yeah, because DJMcMayhem posted that after reading this. \$\endgroup\$
    – MD XF
    Commented May 16, 2017 at 16:22
  • \$\begingroup\$ @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. \$\endgroup\$ Commented Jul 15, 2017 at 6:54

You must log in to answer this question.

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