aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-23 10:49:21 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-23 10:49:21 -0700
commitc916a07bad3426543918635bd32879833d44f1a9 (patch)
tree1eeaab2866f0bc1c6e9a4fb0d23fb7ea190892d8 /src/Text/Pandoc/Readers
parent55315ed0d82a3aad965fc681e4c5eeab01f054a8 (diff)
downloadpandoc-c916a07bad3426543918635bd32879833d44f1a9.tar.gz
Man reader: ignore `\s` font size changes.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Man.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs
index 73a7dcd72..fe6bc5c4c 100644
--- a/src/Text/Pandoc/Readers/Man.hs
+++ b/src/Text/Pandoc/Readers/Man.hs
@@ -172,6 +172,7 @@ escapeLexer = try $ do
'(' -> twoCharGlyph
'[' -> bracketedGlyph
'f' -> escFont
+ 's' -> escFontSize
'"' -> mempty <$ skipMany (satisfy (/='\n')) -- line comment
'#' -> mempty <$ manyTill anyChar newline
'%' -> return mempty
@@ -242,6 +243,15 @@ escapeLexer = try $ do
Nothing -> mzero
Just c -> return c
+ -- \s-1 \s0 -- we ignore these
+ escFontSize :: PandocMonad m => ManLexer m String
+ escFontSize = do
+ pos <- getPosition
+ pm <- option "" $ count 1 (oneOf "+-")
+ ds <- many1 digit
+ report $ SkippedContent ("\\s" ++ pm ++ ds) pos
+ return mempty
+
escFont :: PandocMonad m => ManLexer m String
escFont = do
font <- choice