git.iko.soy/typeable/pandoc
on master help sign in
Man reader: skip optional .IP before code block.
0c419a0John MacFarlane
src/Text/Pandoc/Readers/Man.hs+5
@@ -466,9 +466,14 @@ parseInlines = do
466 comment :: PandocMonad m => ManParser m Inlines
466 comment :: PandocMonad m => ManParser m Inlines
467 comment = mcomment >> return mempty
467 comment = mcomment >> return mempty
468
468
469+bareIP :: PandocMonad m => ManParser m ManToken
470+bareIP = msatisfy isBareIP where
471+ isBareIP (MMacro "IP" []) = True
472+ isBareIP _ = False
469
473
470parseCodeBlock :: PandocMonad m => ManParser m Blocks
474parseCodeBlock :: PandocMonad m => ManParser m Blocks
471parseCodeBlock = try $ do
475parseCodeBlock = try $ do
476+ optional bareIP -- some people indent their code
472 mmacro "nf"
477 mmacro "nf"
473 toks <- many (mstr <|> mline <|> mmaybeLink <|> memptyLine <|> mcomment)
478 toks <- many (mstr <|> mline <|> mmaybeLink <|> memptyLine <|> mcomment)
474 mmacro "fi"
479 mmacro "fi"