Closed gpanders closed 4 years ago
You're right, I just tested the same thing with cmark
and I get the same result. The spec is pretty explicit about the #
character being followed by a space, where "space" is U+0020
, so I'm not sure if this is an oversight in the specification or a bug in the implementation (my guess is the former). I've opened an issue with cmark to ask this question, but for the time being I'll update the syntax file to match "any whitespace".
EDIT: From the linked issue:
The current version in master already reads: "The opening sequence of # characters must be followed by spaces or tabs, or by the end of line."
So this is fixed, just not yet in a release.
CommonMark is a retroactive attempt to standardize Markdown. For the purposes of vim-markdown, it's a useful reference but secondary to real world implementations.
According to the CommonMark spec, ATX headings must be followed by a space, i.e.
The spec also allows 1-3 leading spaces before a header:
This updates the syntax file to match these requirements.