Tentative change to tight/loose lists. [jgm/peg-markdown]
See https://github.com/jgm/peg-markdown/commit/c480d05
This commit is contained in:
parent
5fa71aa19e
commit
33db340b24
16
parser.leg
16
parser.leg
@ -194,7 +194,7 @@ BulletList = &Bullet (ListTight | ListLoose)
|
|||||||
{ $$.key = BULLETLIST }
|
{ $$.key = BULLETLIST }
|
||||||
|
|
||||||
ListTight = a:StartList
|
ListTight = a:StartList
|
||||||
( ListItem { a = cons($$, a) } )+
|
( ListItemTight { a = cons($$, a) } )+
|
||||||
BlankLine* !(Bullet | Enumerator | DefMarker)
|
BlankLine* !(Bullet | Enumerator | DefMarker)
|
||||||
{ $$ = mk_list(LIST, a) }
|
{ $$ = mk_list(LIST, a) }
|
||||||
|
|
||||||
@ -218,6 +218,20 @@ ListItem = ( Bullet | Enumerator | DefMarker )
|
|||||||
$$.children = raw
|
$$.children = raw
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ListItemTight =
|
||||||
|
( Bullet | Enumerator | DefMarker )
|
||||||
|
a:StartList
|
||||||
|
ListBlock { a = cons($$, a) }
|
||||||
|
( !BlankLine
|
||||||
|
ListContinuationBlock { a = cons($$, a) } )*
|
||||||
|
!ListContinuationBlock
|
||||||
|
{
|
||||||
|
raw := mk_str_from_list(a, false)
|
||||||
|
raw.key = RAW
|
||||||
|
$$ = mk_element(LISTITEM)
|
||||||
|
$$.children = raw
|
||||||
|
}
|
||||||
|
|
||||||
ListBlock = a:StartList
|
ListBlock = a:StartList
|
||||||
!BlankLine Line { a = cons($$, a) }
|
!BlankLine Line { a = cons($$, a) }
|
||||||
( ListBlockLine { a = cons($$, a) } )*
|
( ListBlockLine { a = cons($$, a) } )*
|
||||||
|
Loading…
Reference in New Issue
Block a user