diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-10-20 07:48:20 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-10-20 09:30:37 -0700 |
commit | faa35bb014626fd4143b54904827d5bbc82bd15c (patch) | |
tree | 00ed3a99f17ecf8b6231efd6c3019a711d536064 /src | |
parent | 11e681edac3cbdc94af90bee8370e8aa4fddf955 (diff) | |
download | pandoc-faa35bb014626fd4143b54904827d5bbc82bd15c.tar.gz |
Man reader: minor refactoring.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Man.hs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs index e420ee0ab..458a9bfce 100644 --- a/src/Text/Pandoc/Readers/Man.hs +++ b/src/Text/Pandoc/Readers/Man.hs @@ -510,7 +510,7 @@ type ListBuilder = [Blocks] -> Blocks parseList :: PandocMonad m => ManParser m Blocks parseList = try $ do - xx <- many1 paras + xx <- many1 items let bls = map snd xx let bldr = fst $ head xx return $ bldr bls @@ -528,20 +528,20 @@ parseList = try $ do Left _ -> bulletList listKind _ = bulletList - paras :: PandocMonad m => ManParser m (ListBuilder, Blocks) - paras = do + items :: PandocMonad m => ManParser m (ListBuilder, Blocks) + items = do (MMacro _ args) <- mmacro "IP" let lbuilder = listKind args inls <- parseInlines continuations <- mconcat <$> many continuation return $ (lbuilder, para inls <> continuations) - continuation :: PandocMonad m => ManParser m Blocks - continuation = do - mmacro "RS" - bs <- mconcat <$> many (notFollowedBy (mmacro "RE") >> parseBlock) - mmacro "RE" - return bs +continuation :: PandocMonad m => ManParser m Blocks +continuation = do + mmacro "RS" + bs <- mconcat <$> many (notFollowedBy (mmacro "RE") >> parseBlock) + mmacro "RE" + return bs -- In case of weird man file it will be parsed succesfully parseSkipMacro :: PandocMonad m => ManParser m Blocks |