diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-10-23 00:07:39 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-10-23 00:07:39 -0700 |
commit | 8b82667f8ae8f75f52bfcaeba40e7cddc0cf54e6 (patch) | |
tree | e31560b0128290959afe5e0d666d2714cde84f28 | |
parent | bda1c0da81ac5f251ca7958fb0c20b4ea39eea70 (diff) | |
download | pandoc-8b82667f8ae8f75f52bfcaeba40e7cddc0cf54e6.tar.gz |
Man reader: allow lowercase b,i etc. for font commands.
These seem to work.
-rw-r--r-- | src/Text/Pandoc/Readers/Man.hs | 13 |
1 files 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 |