aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-21 12:53:26 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-21 12:53:26 -0700
commit6b553c2e2204d82a627847679bf56db062f1750a (patch)
treee2add056b572dd9819f920fd01216931f6bb89a8 /src/Text
parentf3a71d723bcdb0665b51e489f91cb290e6543762 (diff)
downloadpandoc-6b553c2e2204d82a627847679bf56db062f1750a.tar.gz
Man reader: Moved handling of P, PP, LP to parser phase.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Man.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs
index 86f5b1bc5..9cffb10e8 100644
--- a/src/Text/Pandoc/Readers/Man.hs
+++ b/src/Text/Pandoc/Readers/Man.hs
@@ -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