You can make either entity work as expected if you put it in a <pre> tag.
The <pre> tag is for preformatted text, so it will attempt to display normal plaintext conventions like newlines, multiple spaces, and so on...
I personally like to use the <pre> tag in conjunction with:
white-space: pre-line;
for more normal content box wrapping - but it will depend on your application I imagine...
example: https://jsfiddle.net/mhouser_nowmediagroup/m3ywpLj0/