From 3e23b472f2ec46b5658de8c677f534c5b82c3d25 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 20 Oct 2018 11:06:30 -0700 Subject: Man reader: skip macro definitions for now. --- src/Text/Pandoc/Readers/Man.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/Text/Pandoc/Readers/Man.hs') diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs index d081a5752..6a89f25d9 100644 --- a/src/Text/Pandoc/Readers/Man.hs +++ b/src/Text/Pandoc/Readers/Man.hs @@ -136,6 +136,7 @@ parseBlock = choice [ parseList , parseSkippedContent , parseCodeBlock , parseHeader + , parseMacroDef , parseSkipMacro ] @@ -567,6 +568,17 @@ definitionListItem = try $ do parseDefinitionList :: PandocMonad m => ManParser m Blocks parseDefinitionList = definitionList <$> many1 definitionListItem +parseMacroDef :: PandocMonad m => ManParser m Blocks +parseMacroDef = do + MMacro _ _args <- mmacro "de" + bs <- manyTill parseBlock endMacro + return mempty -- TODO for now just skip it + + where + endMacro = (msatisfy (\t -> case t of + MEndMacro -> True + _ -> False)) + -- In case of weird man file it will be parsed succesfully parseSkipMacro :: PandocMonad m => ManParser m Blocks parseSkipMacro = do -- cgit v1.2.3