From 56c4a11f97ce61085f1435e806437fbdb2638bd0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 19 Oct 2018 15:16:05 -0700 Subject: Man reader: minor improvements. use `trimInlines` for Para content to avoid leading and trailing spaces. Fix handling of \" in middle of line. Add more tests for escapes. --- src/Text/Pandoc/Readers/Man.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs index d248a0714..02cdd83d2 100644 --- a/src/Text/Pandoc/Readers/Man.hs +++ b/src/Text/Pandoc/Readers/Man.hs @@ -216,8 +216,8 @@ escapeLexer = do escSingle = do c <- anyChar case c of - '"' -> mempty <$ manyTill anyChar newline -- line comment - '#' -> mempty <$ (manyTill anyChar newline >> optional newline) + '"' -> mempty <$ skipMany (satisfy (/='\n')) -- line comment + '#' -> mempty <$ manyTill anyChar newline '%' -> return mempty '{' -> return mempty '}' -> return mempty @@ -478,7 +478,7 @@ strToInlines (s, fonts) = inner $ S.toList fonts where inner (Regular:fs) = inner fs parsePara :: PandocMonad m => ManParser m Blocks -parsePara = para <$> parseInlines +parsePara = para . trimInlines <$> parseInlines parseInlines :: PandocMonad m => ManParser m Inlines parseInlines = do -- cgit v1.2.3