From 8b82667f8ae8f75f52bfcaeba40e7cddc0cf54e6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 23 Oct 2018 00:07:39 -0700 Subject: Man reader: allow lowercase b,i etc. for font commands. These seem to work. --- src/Text/Pandoc/Readers/Man.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs index cd17e96f3..d93e3190b 100644 --- a/src/Text/Pandoc/Readers/Man.hs +++ b/src/Text/Pandoc/Readers/Man.hs @@ -244,7 +244,8 @@ escapeLexer = try $ do escFont :: PandocMonad m => ManLexer m String escFont = do - font <- choice [ S.singleton <$> letterFontKind + font <- choice + [ S.singleton <$> letterFontKind , char '(' >> anyChar >> anyChar >> return (S.singleton Regular) , try lettersFont , digit >> return (S.singleton Regular) @@ -256,16 +257,16 @@ escapeLexer = try $ do lettersFont = do char '[' fs <- many letterFontKind - many letter + skipMany letter char ']' return $ S.fromList fs letterFontKind :: PandocMonad m => ManLexer m FontKind letterFontKind = choice [ - char 'B' >> return Bold - , char 'I' >> return Italic - , char 'C' >> return Monospace - , (char 'P' <|> char 'R') >> return Regular + oneOf ['B','b'] >> return Bold + , oneOf ['I','i'] >> return Italic + , oneOf ['C','c'] >> return Monospace + , oneOf ['P','p','R','r'] >> return Regular ] escUnknown :: PandocMonad m => String -> a -> ManLexer m a -- cgit v1.2.3