Tentative change to tight/loose lists. [jgm/peg-markdown]

See https://github.com/jgm/peg-markdown/commit/c480d05
This commit is contained in:
Michael Teichgräber 2011-02-21 03:19:57 +01:00
parent 5fa71aa19e
commit 33db340b24

View File

@ -194,7 +194,7 @@ BulletList = &Bullet (ListTight | ListLoose)
{ $$.key = BULLETLIST }
ListTight = a:StartList
( ListItem { a = cons($$, a) } )+
( ListItemTight { a = cons($$, a) } )+
BlankLine* !(Bullet | Enumerator | DefMarker)
{ $$ = mk_list(LIST, a) }
@ -218,6 +218,20 @@ ListItem = ( Bullet | Enumerator | DefMarker )
$$.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
!BlankLine Line { a = cons($$, a) }
( ListBlockLine { a = cons($$, a) } )*