diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-10-19 23:59:12 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-10-19 23:59:12 -0700 |
commit | 0c419a01f7c554e7ad5f26a035db0cc63b72fedb (patch) | |
tree | 14d265439154a145b5292113f4eae01c04e51263 /src/Text/Pandoc | |
parent | c60ac7c9ab157abf5c0c6450b8c130c477cff3c7 (diff) | |
download | pandoc-0c419a01f7c554e7ad5f26a035db0cc63b72fedb.tar.gz |
Man reader: skip optional .IP before code block.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/Man.hs | 5 |
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" |