7.3.2 Minor Markdown Variations ↑
7.3.2.2 Heading Identification
John Gruber’s description of Markdown syntax leaves room for some ambiguity surrounding two questions concerning the use of one or more hash characters to indicate a heading:
Must a heading line be preceded by a blank line?
Must the string of hash characters be followed by a space, before beginning the text of the heading?
The Markdown Guide makes note of this ambiguity, and the resulting differences in interpretation among various Markdown parsers, but does not provide a definitive resolution for either question. (See Heading Best Practices.)
Notenik’s own parser answers the questions above in the following manner.
A blank line before a heading is recommended (for readability, if nothing else), but is not required.
A space after the last hash character is also recommended, but not required.
However, if there is no intervening space, and the first character following the only hash character is a digit, then the Notenik parser will assume that the author’s intent was for the hash character to be read as ‘number’, rather than triggering a heading.
For example:
#7 is a good bet in the next race.
But…
Number 7 is a good bet in the next race.
Also see the Tags Handling option for a potential modification to the handling of a leading hash character without a following space.
Next: Heading auto-numbering