aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-19 23:59:12 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-19 23:59:12 -0700
commit0c419a01f7c554e7ad5f26a035db0cc63b72fedb (patch)
tree14d265439154a145b5292113f4eae01c04e51263
parentc60ac7c9ab157abf5c0c6450b8c130c477cff3c7 (diff)
downloadpandoc-0c419a01f7c554e7ad5f26a035db0cc63b72fedb.tar.gz
Man reader: skip optional .IP before code block.
-rw-r--r--src/Text/Pandoc/Readers/Man.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs
index e4bf58081..e420ee0ab 100644
--- a/src/Text/Pandoc/Readers/Man.hs
+++ b/src/Text/Pandoc/Readers/Man.hs
@@ -466,9 +466,14 @@ parseInlines = do
comment :: PandocMonad m => ManParser m Inlines
comment = mcomment >> return mempty
+bareIP :: PandocMonad m => ManParser m ManToken
+bareIP = msatisfy isBareIP where
+ isBareIP (MMacro "IP" []) = True
+ isBareIP _ = False
parseCodeBlock :: PandocMonad m => ManParser m Blocks
parseCodeBlock = try $ do
+ optional bareIP -- some people indent their code
mmacro "nf"
toks <- many (mstr <|> mline <|> mmaybeLink <|> memptyLine <|> mcomment)
mmacro "fi"