parser.leg: AtxStart: do a quick lookahead for `#'

This commit is contained in:
Michael Teichgräber 2010-12-13 18:14:10 +01:00
parent 13d48d799e
commit 62502ab7a8

View File

@ -129,7 +129,7 @@ Plain = a:Inlines
AtxInline = !Newline !(Sp '#'* Sp Newline) Inline
AtxStart = < ( "######" | "#####" | "####" | "###" | "##" | "#" ) >
AtxStart = &'#' < ( "######" | "#####" | "####" | "###" | "##" | "#" ) >
{ $$ = mk_element(H1 + (len(yytext) - 1)) }
AtxHeading = s:AtxStart Sp a:StartList ( AtxInline { a = cons($$, a) } )+ (Sp '#'* Sp)? Newline