From e993712b2bd03e58277c239297b19a7f6467abed Mon Sep 17 00:00:00 2001 From: Christian Tietze Date: Wed, 2 Aug 2017 12:57:47 +0200 Subject: [PATCH] require space after Atx heading hashes Since `Sp` is defined as `Spacechar*`, right now a line like: #foo Will be treated as a heading, which is uncommon enough for the CommonMark spec to specify as a mistake :) -- In practical terms, this makes editors with hashtags at the beginning of a line behave weirdly. --- pmh_grammar.leg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmh_grammar.leg b/pmh_grammar.leg index a56db6f..b22ce92 100644 --- a/pmh_grammar.leg +++ b/pmh_grammar.leg @@ -55,7 +55,7 @@ Plain = Inlines AtxInline = !Newline !(Sp '#'* Sp Newline) Inline -AtxStart = < ( "######" | "#####" | "####" | "###" | "##" | "#" ) > +AtxStart = < ( "######" | "#####" | "####" | "###" | "##" | "#" ) Spacechar > { $$ = elem((pmh_element_type)(pmh_H1 + (strlen(yytext) - 1))); } AtxHeading = < s:AtxStart Sp ( AtxInline )+ (Sp '#'* Sp)? Newline >