Quantcast
Channel: Active questions tagged code-formatting - Meta Stack Overflow
Viewing all articles
Browse latest Browse all 189

No-break space in code block renders as normal space [duplicate]

$
0
0

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:

screenshot of markdown with no-break space made visible

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 ASwitched to a new branch 'US24024 Automated Tests - Profile A'
  1. Is there a particular reason that this choice of substitution is made?
  2. Is it possible to disable this substitution in the entire site?
  3. Is it possible to disable this substitution in a particular code block?

Important Notes:

  1. 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.)
  2. 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.

Viewing all articles
Browse latest Browse all 189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>