aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-19 22:54:05 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-19 22:54:05 -0700
commitf5704fac9769e4b236cfe70292f77b80b19accc6 (patch)
tree09849dc0954715276a6e788a90fbf971a387f6c4 /src
parent3b710b6fa7aad461302225abedd273dab06a40cd (diff)
downloadpandoc-f5704fac9769e4b236cfe70292f77b80b19accc6.tar.gz
Man reader: properly handle multi-block list items.
Closes #4985.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Man.hs12
1 files changed, 6 insertions, 6 deletions
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