diff --git a/src/Text/Pandoc/Readers/Mdoc.hs b/src/Text/Pandoc/Readers/Mdoc.hs index 01008f6a7d03..6141bd7054ef 100644 --- a/src/Text/Pandoc/Readers/Mdoc.hs +++ b/src/Text/Pandoc/Readers/Mdoc.hs @@ -802,18 +802,19 @@ parseBd = do emptyMacro "Ed" return blk -skipListArguments :: PandocMonad m => MdocParser m () -skipListArguments = do - optional (literal "-width" *> lit) - optional (literal "-offset" *> lit) - optional (literal "-compact") - return () +skipListArgument :: (PandocMonad m) => MdocParser m () +skipListArgument = + void $ choice + [ literal "-width" *> lit, + literal "-offset" *> lit, + literal "-compact" + ] parseItemList :: PandocMonad m => MdocParser m Blocks parseItemList = do f <- (choice (map literal ["-bullet", "-dash", "-hyphen", "-item"]) $> B.bulletList) <|> literal "-enum" $> B.orderedList - skipListArguments + many skipListArgument eol items <- many bulletItem return $ f items @@ -825,7 +826,7 @@ parseItemList = do parseDefinitionList :: PandocMonad m => MdocParser m Blocks parseDefinitionList = do choice $ map literal ["-hang", "-inset", "-ohang", "-tag"] - skipListArguments + many skipListArgument eol items <- many dlItem return $ B.definitionList items @@ -846,7 +847,7 @@ parseDefinitionList = do parseColumnList :: PandocMonad m => MdocParser m Blocks parseColumnList = do literal "-column" - skipListArguments + many skipListArgument _ <- litsToText -- XXX use the column widths? eol rows <- many listRow