Sp? is redundant… [jgm/peg-markdown]
See https://github.com/jgm/peg-markdown/commit/b220285
This commit is contained in:
parent
feacd19307
commit
a032b690e8
|
@ -138,12 +138,12 @@ Para = NonindentSpace a:Inlines BlankLine+
|
|||
Plain = a:Inlines
|
||||
{ $$ = a; $$.key = PLAIN }
|
||||
|
||||
AtxInline = !Newline !(Sp? '#'* Sp Newline) Inline
|
||||
AtxInline = !Newline !(Sp '#'* Sp Newline) Inline
|
||||
|
||||
AtxStart = &'#' < ( "######" | "#####" | "####" | "###" | "##" | "#" ) >
|
||||
{ $$ = p.mkElem(H1 + (len(yytext) - 1)) }
|
||||
|
||||
AtxHeading = s:AtxStart Sp? a:StartList ( AtxInline { a = cons($$, a) } )+ (Sp? '#'* Sp)? Newline
|
||||
AtxHeading = s:AtxStart Sp a:StartList ( AtxInline { a = cons($$, a) } )+ (Sp '#'* Sp)? Newline
|
||||
{ $$ = p.mkList(s.key, a)
|
||||
s = nil }
|
||||
|
||||
|
@ -154,11 +154,11 @@ SetextBottom1 = '='+ Newline
|
|||
SetextBottom2 = '-'+ Newline
|
||||
|
||||
SetextHeading1 = &(RawLine SetextBottom1)
|
||||
a:StartList ( !Endline Inline { a = cons($$, a) } )+ Sp? Newline
|
||||
a:StartList ( !Endline Inline { a = cons($$, a) } )+ Sp Newline
|
||||
SetextBottom1 { $$ = p.mkList(H1, a) }
|
||||
|
||||
SetextHeading2 = &(RawLine SetextBottom2)
|
||||
a:StartList ( !Endline Inline { a = cons($$, a) } )+ Sp? Newline
|
||||
a:StartList ( !Endline Inline { a = cons($$, a) } )+ Sp Newline
|
||||
SetextBottom2 { $$ = p.mkList(H2, a) }
|
||||
|
||||
Heading = SetextHeading | AtxHeading
|
||||
|
|
Loading…
Reference in New Issue