aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-19 15:16:05 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-19 15:17:53 -0700
commit56c4a11f97ce61085f1435e806437fbdb2638bd0 (patch)
tree57dcdebf1db2cc932493193ea52929ca0f19cef0 /src/Text/Pandoc
parente6772360f661c50eea2f83dc4110185da3ad0f74 (diff)
downloadpandoc-56c4a11f97ce61085f1435e806437fbdb2638bd0.tar.gz
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.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/Man.hs6
1 files changed, 3 insertions, 3 deletions
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