The discussion is about the replacement of no-break space (NBSP, U+00A0) and narrow no-break space (NNBSP, U+202F) with normal space (SP, U+0020) by Discourse. jesus2099 pointed out that this causes issues with French number display when text is wrapping, and Julien_Palard explained that in French, no-break spaces are used before punctuation like :, !, ?, and between groups of three digits in big numbers.
codinghorror suggested using HTML entities for these characters, and jesus2099 found that using the Unicode code   for NNBSP works. However, jesus2099 expressed that it’s hard to remember this syntax.
The reason for replacing no-break spaces with normal spaces is to prevent trivial griefing, as explained by sam. However, zogstrip and oca suggested making the normalize_whitespaces method optional, so that local admins can opt-out of this feature if needed.
Jagster questioned the use of no-break spaces in French typography, but Julien_Palard provided sources confirming that in French, punctuation should be spaced from the word on their left using a narrow no-break space.
Would it be possible to allow no-break space (NBSP, U+00A0) and even narrow no-break space (NNBSP, U+202F) in the posts?
Currently they are replaced by normal space (SP, U+0020) by Discourse (even in code fragments), thus breaking French number display when text is wrapping.
In French, there should be an NNBSP at least, before punctuation like !?;:», after punctuation like «–—, and between groups of three digits in big numbers.
Here is an example of broken display per French standards:
Let’s try   for NARROW NO-BREAK SPACE thousands separator 80 000 test 80 000 test 80 000 test 80 000 test 80 000 80 000 test 80 000 test 80 000 80 000 test 80 000 test 80 000 test 80 000 test 80 000 test 80 000 test 80 000 test 80 000 80 000 test 80 000 test 80 000 test 80 000 test 80 000.
Then it works indeed!
I edited my post on the other forum and now the numbers are displayed good.
There is no named HTML entity but I can use the unicode code like this.
Thanks for the work-around, @codinghorror.
+1 on this, in French, we use a non-breaking space before our :, !, ? as they are spaced from the previous word and we don’t want them to land on the next line.
Current behavior of replacing non-breaking spaces with spaces:
By keeping the non-breaking space, there is no longer the “lone semicolon”:
I don’t think there’s a need for an HTML escape sequence for those characters, just like there’s no need for an HTML escape sequence for any other non-ASCII characters: pages are given to the browser encoded in UTF-8, and non-breaking spaces, like all other characters, have a UTF-8 representation, for example:
→, √, ½, ñ, Ł, …
(In other words, why does Discourse allow most Unicode sequences but not non-breaking spaces?)
I think this was done to avoid a form of trivial griefing where people make edits to posts and they change nothing and people scratch head to say … what has changed?
Yeah that’s what I remember as well. I would be fine removing this mornalize_whitespaces method provided we have a better way of doing/showing the diffs when such “characters” are used to grief.
Can the mornalize_whitespaces be realized when a new setting (on by default) ask it? Then a local admin could opt-out of this feature when for their usage, the griefing is less a problem than typography ?
In the « Lexique des règles typographiques en usage à l’Imprimerie nationale » (Glossary of typographical rules used by the National Printing Office), page 149 we see: « espace fine insécable ? espace juistifiante » so they don’t tell to use a U+00A0 (NO-BREAK SPACE) but a U+202F (NARROW NO-BREAK SPACE) (that I don’t know how to type on my keyboard, but still it’s not a U+0020 (SPACE). (Sadly the book is not free so I don’t have a hyperlink to it).
French Wikipedia tells: « En France, il est d’usage de placer une espace fine insécable avant le point d’interrogation, ou une espace insécable si la fine n’est pas disponible. » (In France, it is customary to place a thin non-breaking space before the question mark, or a non-breaking space if the fine is not available.)
One study/workbook for beginners who think they can learn french I should go to back…, I don’t know what it is in english but something like community eveningschool for adults — a way to spend freetime and learn something new — and take a picture of that text.
But I stand correct. You know for sure this better than me ever,