git.iko.soy/typeable/pandoc
on master help sign in
Man reader: Moved handling of P, PP, LP to parser phase.
commit6b553c2e2204d82a627847679bf56db062f1750a authorJohn MacFarlane <jgm@berkeley.edu> dateSun 21 Oct 2018, 12:53 (8 years ago) parentf3a71d7
1 file changed+7−5
src/Text/Pandoc/Readers/Man.hs+7−5
src/Text/Pandoc/Readers/Man.hs+7−5
@@ -155,13 +155,18 @@ parseBlock = choice [ parseList
155155 , parseDefinitionList
156156 , parseBlockQuote
157157 , parseTitle
158+ , parseNewParagraph
158159 , parsePara
159− , parseSkippedContent
160160 , parseCodeBlock
161161 , parseHeader
162162 , skipUnkownMacro
163163 ]
164164
165+parseNewParagraph :: PandocMonad m => ManParser m Blocks
166+parseNewParagraph = do
167+ mmacro "P" <|> mmacro "PP" <|> mmacro "LP" <|> memptyLine
168+ return mempty
169+
165170eofline :: Stream s m Char => ParsecT s u m ()
166171eofline = void newline <|> eof
167172
@@ -299,7 +304,7 @@ lexMacro = do
299304 "\\\"" -> return mempty
300305 "\\#" -> return mempty
301306 "de" -> lexMacroDef args
302− x | x `elem` [ "P", "PP", "LP", "sp"] -> return $ singleTok MEmptyLine
307+ "sp" -> return $ singleTok MEmptyLine
303308 _ -> resolveMacro macroName args
304309
305310 where
@@ -479,9 +484,6 @@ parseTitle = do
479484 modifyState $ \st -> st{ metadata = adjustMeta $ metadata st }
480485 return mempty
481486
482−parseSkippedContent :: PandocMonad m => ManParser m Blocks
483−parseSkippedContent = mempty <$ memptyLine
484−
485487linePartsToInlines :: [LinePart] -> Inlines
486488linePartsToInlines = go
487489