From 0c419a01f7c554e7ad5f26a035db0cc63b72fedb Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 19 Oct 2018 23:59:12 -0700 Subject: [PATCH] Man reader: skip optional .IP before code block. --- src/Text/Pandoc/Readers/Man.hs | 5 +++++ 1 file changed, 5 insertions(+) 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"