Man reader: Moved handling of P, PP, LP to parser phase.
This commit is contained in:
parent
f3a71d723b
commit
6b553c2e22
1 changed files with 7 additions and 5 deletions
|
@ -155,13 +155,18 @@ parseBlock = choice [ parseList
|
|||
, parseDefinitionList
|
||||
, parseBlockQuote
|
||||
, parseTitle
|
||||
, parseNewParagraph
|
||||
, parsePara
|
||||
, parseSkippedContent
|
||||
, parseCodeBlock
|
||||
, parseHeader
|
||||
, skipUnkownMacro
|
||||
]
|
||||
|
||||
parseNewParagraph :: PandocMonad m => ManParser m Blocks
|
||||
parseNewParagraph = do
|
||||
mmacro "P" <|> mmacro "PP" <|> mmacro "LP" <|> memptyLine
|
||||
return mempty
|
||||
|
||||
eofline :: Stream s m Char => ParsecT s u m ()
|
||||
eofline = void newline <|> eof
|
||||
|
||||
|
@ -299,7 +304,7 @@ lexMacro = do
|
|||
"\\\"" -> return mempty
|
||||
"\\#" -> return mempty
|
||||
"de" -> lexMacroDef args
|
||||
x | x `elem` [ "P", "PP", "LP", "sp"] -> return $ singleTok MEmptyLine
|
||||
"sp" -> return $ singleTok MEmptyLine
|
||||
_ -> resolveMacro macroName args
|
||||
|
||||
where
|
||||
|
@ -479,9 +484,6 @@ parseTitle = do
|
|||
modifyState $ \st -> st{ metadata = adjustMeta $ metadata st }
|
||||
return mempty
|
||||
|
||||
parseSkippedContent :: PandocMonad m => ManParser m Blocks
|
||||
parseSkippedContent = mempty <$ memptyLine
|
||||
|
||||
linePartsToInlines :: [LinePart] -> Inlines
|
||||
linePartsToInlines = go
|
||||
|
||||
|
|
Loading…
Reference in a new issue