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
|
Plain = a:Inlines
|
||||||
{ $$ = a; $$.key = PLAIN }
|
{ $$ = a; $$.key = PLAIN }
|
||||||
|
|
||||||
AtxInline = !Newline !(Sp? '#'* Sp Newline) Inline
|
AtxInline = !Newline !(Sp '#'* Sp Newline) Inline
|
||||||
|
|
||||||
AtxStart = &'#' < ( "######" | "#####" | "####" | "###" | "##" | "#" ) >
|
AtxStart = &'#' < ( "######" | "#####" | "####" | "###" | "##" | "#" ) >
|
||||||
{ $$ = p.mkElem(H1 + (len(yytext) - 1)) }
|
{ $$ = 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)
|
{ $$ = p.mkList(s.key, a)
|
||||||
s = nil }
|
s = nil }
|
||||||
|
|
||||||
@ -154,11 +154,11 @@ SetextBottom1 = '='+ Newline
|
|||||||
SetextBottom2 = '-'+ Newline
|
SetextBottom2 = '-'+ Newline
|
||||||
|
|
||||||
SetextHeading1 = &(RawLine SetextBottom1)
|
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) }
|
SetextBottom1 { $$ = p.mkList(H1, a) }
|
||||||
|
|
||||||
SetextHeading2 = &(RawLine SetextBottom2)
|
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) }
|
SetextBottom2 { $$ = p.mkList(H2, a) }
|
||||||
|
|
||||||
Heading = SetextHeading | AtxHeading
|
Heading = SetextHeading | AtxHeading
|
||||||
|
Loading…
Reference in New Issue
Block a user