@@ -572,10 +572,8 @@ bulletListItemsUntil indent end = try $ do
573 void spaceChar <|> lookAhead eol
573 void spaceChar <|> lookAhead eol
574 updateState (\st -> st { museInPara = False })
574 updateState (\st -> st { museInPara = False })
575− (x, e) <- listItemContentsUntil (indent + 2) (Right <$> try (optional blankline >> indentWith indent >> bulletListItemsUntil indent end)) (Left <$> end)
575+ (x, (xs, e)) <- listItemContentsUntil (indent + 2) (try (optional blankline >> indentWith indent >> bulletListItemsUntil indent end)) (([],) <$> end)
577− Left ee -> return ([x], ee)
578− Right (xs, ee) -> return (x:xs, ee)
576+ return (x:xs, e)
580-- | Parse a bullet list.
578-- | Parse a bullet list.
581bulletListUntil :: PandocMonad m
579bulletListUntil :: PandocMonad m
@@ -621,10 +619,8 @@ orderedListItemsUntil indent style end =
621 pos <- getPosition
619 pos <- getPosition
622 void spaceChar <|> lookAhead eol
620 void spaceChar <|> lookAhead eol
623 updateState (\st -> st { museInPara = False })
621 updateState (\st -> st { museInPara = False })
624− (x, e) <- listItemContentsUntil (sourceColumn pos) (Right <$> try (optional blankline >> indentWith indent >> museOrderedListMarker style >> continuation)) (Left <$> end)
622+ (x, (xs, e)) <- listItemContentsUntil (sourceColumn pos) (try (optional blankline >> indentWith indent >> museOrderedListMarker style >> continuation)) (([],) <$> end)
626− Left ee -> return ([x], ee)
627− Right (xs, ee) -> return (x:xs, ee)
623+ return (x:xs, e)
629-- | Parse an ordered list.
625-- | Parse an ordered list.
630orderedListUntil :: PandocMonad m
626orderedListUntil :: PandocMonad m
@@ -647,10 +643,8 @@ descriptionsUntil :: PandocMonad m
647descriptionsUntil indent end = do
643descriptionsUntil indent end = do
648 void spaceChar <|> lookAhead eol
644 void spaceChar <|> lookAhead eol
649 updateState (\st -> st { museInPara = False })
645 updateState (\st -> st { museInPara = False })
650− (x, e) <- listItemContentsUntil indent (Right <$> try (optional blankline >> indentWith indent >> manyTill spaceChar (string "::") >> descriptionsUntil indent end)) (Left <$> end)
646+ (x, (xs, e)) <- listItemContentsUntil indent (try (optional blankline >> indentWith indent >> manyTill spaceChar (string "::") >> descriptionsUntil indent end)) (([],) <$> end)
651− case e of
647+ return (x:xs, e)
652− Right (xs, ee) -> return (x:xs, ee)
653− Left ee -> return ([x], ee)
655definitionListItemsUntil :: PandocMonad m
649definitionListItemsUntil :: PandocMonad m
@@ -662,14 +656,9 @@ definitionListItemsUntil indent end =
662 continuation = try $ do
656 continuation = try $ do
663 pos <- getPosition
657 pos <- getPosition
664 term <- trimInlinesF . mconcat <$> manyTill (choice inlineList) (try $ string "::")
658 term <- trimInlinesF . mconcat <$> manyTill (choice inlineList) (try $ string "::")
665− (x, e) <- descriptionsUntil (sourceColumn pos) ((Right <$> try (optional blankline >> indentWith indent >> continuation)) <|> (Left <$> end))
659+ (x, (xs, e)) <- descriptionsUntil (sourceColumn pos) (try (optional blankline >> indentWith indent >> continuation) <|> (([],) <$> end))
668− x' <- sequence x
660+ let xx = (,) <$> term <*> sequence x
671− Left ee -> return ([xx], ee)
672− Right (xs, ee) -> return (xx:xs, ee)
661+ return (xx:xs, e)
674-- | Parse a definition list.
663-- | Parse a definition list.
675definitionListUntil :: PandocMonad m
664definitionListUntil :: PandocMonad m