Use escaped space as  

I think using NBSP has primarily to do with whether you care about typography or not: in my Markdown texts I use NBSP pretty often, and I write in English or German.

Consider cases like these (using the tilde “~” as a “visible” NBSP, which btw I would prefer much over the “\” followed by a SP which the OP suggested):

25.4~mm is 1.00~in.
[...] in section~1. But in the following [...]
Up to~3 spaces at the beginning of a line.
"The Hobbit" is a novel by J~R~R Tolkien.
There is~- or is not~- an example for this.
There is~-- or is not~-- an example for this.
There is---or is not---an example for this.

[The last three lines show different typescript styles for entering what in printed text would be EN DASH rsp EM DASH; rsp to provoke the --smart option of cmark to produce such dashes.]

The purpose of each of these NBSP uses is obvious: to prevent the character(s) after it from ending up at the beginning of a line, or the character(s) before it from ending up at the end of a line—in both cases of line-breaking involved:

  1. Reformatting the Markdown plain text itself (which I do regularily);
  2. Formatting the output of processing Markdown, eg line-breaking in a browser.

Without NBSP, we risk that said characters will end up at places where they either look ugly, or even confuse the Markdown processor (like in the case of HYPHEN-MINUS followed by SP).


So yes: NBSP in Markdown text is important (even literal NBSP, for formatting Markdown plain text).

And no: I don’t think CommonMark or any other Markdown syntax needs a notation for NBSP—it is both easier and more useful to enter NBSP directly (easy in a proper text editor like Vim), or maybe use “@” or “~” or whatever as a stand-in while editing, and then do a global search-and-replace on this stand-in string to turn it’s occurences into real NBSPs.

I you will not re-format the plain text typescript, a feature aimed at treating problems like the ones I listed above implemented in the Markdown processor would still be more useful than simply providing a notation for entering NBSP:

The Markdown processor could recognize cases like

  • “decimal digits, followed by space, preceded by space or nothing”,
  • “hyphen(s), followed by space, preceded by space or nothing, but not the start of an “unordered” list item”,

and so on, and “insert NBSP” by itself (ie treat the respective SP as if it was NBSP)—which would obviate the need for the author to enter NBSP explicitly, at least in trivially recognizable cases like these. How you can enter a “real” NBSP into your typescript is rather a question you should ask your editing tool, not the CommonMark processor, IMO.

And remember (if you have to use a sh***y editor) that you can always use a numeric character reference in your Markdown input text—ugly but reliable:

25.4 mm is 1 in

The named character reference is only slightly “nicer”, but less reliable:

25.4 mm is 1 in