diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-10-19 15:16:05 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-10-19 15:17:53 -0700 |
commit | 56c4a11f97ce61085f1435e806437fbdb2638bd0 (patch) | |
tree | 57dcdebf1db2cc932493193ea52929ca0f19cef0 /src/Text/Pandoc | |
parent | e6772360f661c50eea2f83dc4110185da3ad0f74 (diff) | |
download | pandoc-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.hs | 6 |
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 |