handled nested lists
This commit is contained in:
parent
bc1ea7e84b
commit
628d85a8f3
1 changed files with 1 additions and 1 deletions
|
|
@ -131,11 +131,11 @@ blockquoteBlock = BlockQuote . Q . concat <$> (some blockquoteLine)
|
||||||
-- nesting amount
|
-- nesting amount
|
||||||
listBlock :: (Logger m, Characters s) => ListType -> Parser s m prefix -> (Int -> Parser s m List) -> Int -> Parser s m Element
|
listBlock :: (Logger m, Characters s) => ListType -> Parser s m prefix -> (Int -> Parser s m List) -> Int -> Parser s m Element
|
||||||
listBlock list_type prefix child_parser_factory nest_level = do
|
listBlock list_type prefix child_parser_factory nest_level = do
|
||||||
error "unhandled ident_level"
|
|
||||||
items <- some $ (try (listItem <* notFollowedBy blockEnding)) <|> (listItem <* lineEnding)
|
items <- some $ (try (listItem <* notFollowedBy blockEnding)) <|> (listItem <* lineEnding)
|
||||||
pure $ List $ L {list_type, items}
|
pure $ List $ L {list_type, items}
|
||||||
where
|
where
|
||||||
listItem = do
|
listItem = do
|
||||||
|
count nest_level ((try $ void $ char '\t') <|> (void $ string " "))
|
||||||
prefix
|
prefix
|
||||||
content <- many inlineText
|
content <- many inlineText
|
||||||
child <- optional $ child_parser_factory $ nest_level + 1
|
child <- optional $ child_parser_factory $ nest_level + 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue