Supporting nonbreaking spaces in headings


#1

I recently ran into some issues with some headers not being parsed by CommonMark and the issue turned out to be caused by non-breaking spaces. The current specification defines a space as U+0020 and the requirements for a header are:

a string of characters, parsed as inline content, between an opening sequence of 1–6 unescaped # characters and an optional closing sequence of any number of unescaped # characters. The opening sequence of # characters must be followed by a space or by the end of line.

The reason why non-breaking spaces sometimes get entered is simple: on a Mac you type Option+3 to create a hash and to create a non-breaking space it’s Option+Space. This means that if you’re still holding down the Option key (usually when typing quickly) and you hit space, you’re going to be entering an character which is incompatible with the CommonMark specification. For obvious reasons it’s impossible to tell the difference between a non-breaking space and a regular space (without breaking out a hex editor), so it’s often hard to tell where the issue lies - other that knowing that something is causing your heading to not parse.

Is it at all possible that the definition of either a space, or a heading, could be updated to allow non-breaking spaces?