I landed here because I was not aware that CSS white-space: pre-wrap
existed. If you are trying to use $nbsp;
to preserve multiple whitespaces, use normal whitespace and CSS rule white-space: pre-wrap
instead. This will also break lines at spaces correctly if there is overflow.