Problem: In a code block, a no-break space is substituted with a regular space. In certain cases, the writer's intention is to utilize a no-break space, not a regular space.
Situation: In this particular answer, the branch name input given to git
command uses "no-break space" (non-breaking space, U+00A0
or
). This is properly utilized in the code block. But in the rendered output, this is replaced with regular normal spaces.
For illustration, the non-breaking space is highlighted with pink blocks here. (Note that this is an illustration only, to show the difference. Stack Overflow is not expected to render like this.)
Markdown:
Rendered output (if you copy this, you'll see that the no-break space has changed to a regular space):
git checkout -b US24024 Automated Tests - Profile A
Switched to a new branch 'US24024 Automated Tests - Profile A'
- Is there a particular reason that this choice of substitution is made?
- Is it possible to disable this substitution in the entire site?
- Is it possible to disable this substitution in a particular code block?
Important Notes:
- The linked answer is demonstrating the use of no-break space as a substitution for regular space for use in a Git branch name. (It is not an attempt to make the code block non-breaking.)
- The pink block is an illustration of the difference only. This bug report doesn't expect the rendering of no-break space in any style other than just a no-break space character in the HTML source code sent to the browser.
render
that's somehow misunderstood, and the pink block exacerbated it by apparently making it seem that I want to see it as a pink block? (I don't.) What I mean is that the HTML source code of the website itself seems to have normal space characters where no-break space characters should be.WONT-FIX
for this particular problem, and the solution is to warn the reader that copying from the code block won't work (and also direct them with an alternative solution). [Also I know about the code block here; after all it's the same editor. I was trying to show that the spaces changed. A picture is worth a thousand words, but not this one? But I will revise. Thanks for suggesting.]