Question: I've just posted [an answer that involved some HTML](https://stackoverflow.com/questions/1093751/can-i-replace-20-with-nbsp-in-urls-that-have-spaces/1093769#1093769), which I indented by four spaces.

```
<a>http://some/url/with&nbsp;nbsp/</a>

```

compare to the original input I made:

```
<a>http://some/url/with&nbsp;nbsp/</a>
```

It seems as though `&nbsp;` gets replaced by an actual non-breaking space within a code section in the final output. I *think* this was not always the case (can someone confirm?), and it generally contradicts the meaning of a code section.

This is also inconsistent with the way text within backticks is treated. Now I know I could circumvent that by using `&amp;nbsp;`, but I'm *very* hesitant of this double encoding of source code.

Is it a bug?

Answer: 
It is a bug, as shown by this example:

```
<td>&nbsp;</td>
<td>&amp;nbsp;</td>

```

The first is &nbsp; and the second is &amp;nbsp;. (I've used an extra level of entification to type the preceding sentence, and hope that it still comes out right when I post it.) Really nasty is that the preview initially shows the code as typed, but then replaces it with a space when it syntax-colours it after some random interval.

The bug does seem to be peculiar to nbsp. I haven't found any other character code that does it.
here is an example of the bug:

[using a html entity in xslt (e.g. &nbsp;)](https://stackoverflow.com/questions/31870/using-a-html-entity-in-xslt-e-g-nbsp)