git.iko.soy/typeable/pandoc
on master help sign in
Man reader: ignore `\s` font size changes.
c916a07John MacFarlane
src/Text/Pandoc/Readers/Man.hs+10
@@ -172,6 +172,7 @@ escapeLexer = try $ do
172 '(' -> twoCharGlyph
172 '(' -> twoCharGlyph
173 '[' -> bracketedGlyph
173 '[' -> bracketedGlyph
174 'f' -> escFont
174 'f' -> escFont
175+ 's' -> escFontSize
175 '"' -> mempty <$ skipMany (satisfy (/='\n')) -- line comment
176 '"' -> mempty <$ skipMany (satisfy (/='\n')) -- line comment
176 '#' -> mempty <$ manyTill anyChar newline
177 '#' -> mempty <$ manyTill anyChar newline
177 '%' -> return mempty
178 '%' -> return mempty
@@ -242,6 +243,15 @@ escapeLexer = try $ do
242 Nothing -> mzero
243 Nothing -> mzero
243 Just c -> return c
244 Just c -> return c
244
245
246+ -- \s-1 \s0 -- we ignore these
247+ escFontSize :: PandocMonad m => ManLexer m String
248+ escFontSize = do
249+ pos <- getPosition
250+ pm <- option "" $ count 1 (oneOf "+-")
251+ ds <- many1 digit
252+ report $ SkippedContent ("\\s" ++ pm ++ ds) pos
253+ return mempty
254+
245 escFont :: PandocMonad m => ManLexer m String
255 escFont :: PandocMonad m => ManLexer m String
246 escFont = do
256 escFont = do
247 font <- choice
257 font <- choice