git.iko.soy/typeable/pandoc
on master help sign in
Man reader: skip optional .IP before code block.
commit0c419a01f7c554e7ad5f26a035db0cc63b72fedb authorJohn MacFarlane <jgm@berkeley.edu> dateFri 19 Oct 2018, 23:59 (8 years ago) parentc60ac7c
1 file changed+5
src/Text/Pandoc/Readers/Man.hs+5
src/Text/Pandoc/Readers/Man.hs+5
@@ -466,9 +466,14 @@ parseInlines = do
466466 comment :: PandocMonad m => ManParser m Inlines
467467 comment = mcomment >> return mempty
468468
469+bareIP :: PandocMonad m => ManParser m ManToken
470+bareIP = msatisfy isBareIP where
471+ isBareIP (MMacro "IP" []) = True
472+ isBareIP _ = False
469473
470474parseCodeBlock :: PandocMonad m => ManParser m Blocks
471475parseCodeBlock = try $ do
476+ optional bareIP -- some people indent their code
472477 mmacro "nf"
473478 toks <- many (mstr <|> mline <|> mmaybeLink <|> memptyLine <|> mcomment)
474479 mmacro "fi"