From f5704fac9769e4b236cfe70292f77b80b19accc6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 19 Oct 2018 22:54:05 -0700 Subject: Man reader: properly handle multi-block list items. Closes #4985. --- src/Text/Pandoc/Readers/Man.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs index 9ead84f3e..4eeeeb825 100644 --- a/src/Text/Pandoc/Readers/Man.hs +++ b/src/Text/Pandoc/Readers/Man.hs @@ -554,15 +554,15 @@ parseList = try $ do (MMacro _ args) <- mmacro "IP" let lbuilder = listKind args inls <- parseInlines - subls <- mconcat <$> many sublist - return $ (lbuilder, plain inls <> subls) + continuations <- mconcat <$> many continuation + return $ (lbuilder, para inls <> continuations) - sublist :: PandocMonad m => ManParser m Blocks - sublist = do + continuation :: PandocMonad m => ManParser m Blocks + continuation = do mmacro "RS" - bl <- parseList + bs <- mconcat <$> many (notFollowedBy (mmacro "RE") >> parseBlock) mmacro "RE" - return bl + return bs -- In case of weird man file it will be parsed succesfully parseSkipMacro :: PandocMonad m => ManParser m Blocks -- cgit v1.2.3