@@ -572,10 +572,8 @@ bulletListItemsUntil indent end = try $ do
572572 char '-'
573573 void spaceChar <|> lookAhead eol
574574 updateState (\st -> st { museInPara = False })
575− (x, e) <- listItemContentsUntil (indent + 2) (Right <$> try (optional blankline >> indentWith indent >> bulletListItemsUntil indent end)) (Left <$> end)
576− case e of
577− Left ee -> return ([x], ee)
578− Right (xs, ee) -> return (x:xs, ee)
575+ (x, (xs, e)) <- listItemContentsUntil (indent + 2) (try (optional blankline >> indentWith indent >> bulletListItemsUntil indent end)) (([],) <$> end)
576+ return (x:xs, e)
579577
580578-- | Parse a bullet list.
581579bulletListUntil :: PandocMonad m
@@ -621,10 +619,8 @@ orderedListItemsUntil indent style end =
621619 pos <- getPosition
622620 void spaceChar <|> lookAhead eol
623621 updateState (\st -> st { museInPara = False })
624− (x, e) <- listItemContentsUntil (sourceColumn pos) (Right <$> try (optional blankline >> indentWith indent >> museOrderedListMarker style >> continuation)) (Left <$> end)
625− case e of
626− Left ee -> return ([x], ee)
627− Right (xs, ee) -> return (x:xs, ee)
622+ (x, (xs, e)) <- listItemContentsUntil (sourceColumn pos) (try (optional blankline >> indentWith indent >> museOrderedListMarker style >> continuation)) (([],) <$> end)
623+ return (x:xs, e)
628624
629625-- | Parse an ordered list.
630626orderedListUntil :: PandocMonad m
@@ -647,10 +643,8 @@ descriptionsUntil :: PandocMonad m
647643descriptionsUntil indent end = do
648644 void spaceChar <|> lookAhead eol
649645 updateState (\st -> st { museInPara = False })
650− (x, e) <- listItemContentsUntil indent (Right <$> try (optional blankline >> indentWith indent >> manyTill spaceChar (string "::") >> descriptionsUntil indent end)) (Left <$> end)
651− case e of
652− Right (xs, ee) -> return (x:xs, ee)
653− Left ee -> return ([x], ee)
646+ (x, (xs, e)) <- listItemContentsUntil indent (try (optional blankline >> indentWith indent >> manyTill spaceChar (string "::") >> descriptionsUntil indent end)) (([],) <$> end)
647+ return (x:xs, e)
654648
655649definitionListItemsUntil :: PandocMonad m
656650 => Int
@@ -662,14 +656,9 @@ definitionListItemsUntil indent end =
662656 continuation = try $ do
663657 pos <- getPosition
664658 term <- trimInlinesF . mconcat <$> manyTill (choice inlineList) (try $ string "::")
665− (x, e) <- descriptionsUntil (sourceColumn pos) ((Right <$> try (optional blankline >> indentWith indent >> continuation)) <|> (Left <$> end))
666− let xx = do
667− term' <- term
668− x' <- sequence x
669− return (term', x')
670− case e of
671− Left ee -> return ([xx], ee)
672− Right (xs, ee) -> return (xx:xs, ee)
659+ (x, (xs, e)) <- descriptionsUntil (sourceColumn pos) (try (optional blankline >> indentWith indent >> continuation) <|> (([],) <$> end))
660+ let xx = (,) <$> term <*> sequence x
661+ return (xx:xs, e)
673662
674663-- | Parse a definition list.
675664definitionListUntil :: PandocMonad m