Man reader: skip optional .IP before code block.
This commit is contained in:
parent
c60ac7c9ab
commit
0c419a01f7
1 changed files with 5 additions and 0 deletions
|
@ -466,9 +466,14 @@ parseInlines = do
|
||||||
comment :: PandocMonad m => ManParser m Inlines
|
comment :: PandocMonad m => ManParser m Inlines
|
||||||
comment = mcomment >> return mempty
|
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 :: PandocMonad m => ManParser m Blocks
|
||||||
parseCodeBlock = try $ do
|
parseCodeBlock = try $ do
|
||||||
|
optional bareIP -- some people indent their code
|
||||||
mmacro "nf"
|
mmacro "nf"
|
||||||
toks <- many (mstr <|> mline <|> mmaybeLink <|> memptyLine <|> mcomment)
|
toks <- many (mstr <|> mline <|> mmaybeLink <|> memptyLine <|> mcomment)
|
||||||
mmacro "fi"
|
mmacro "fi"
|
||||||
|
|
Loading…
Add table
Reference in a new issue