aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-23 00:07:39 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-23 00:07:39 -0700
commit8b82667f8ae8f75f52bfcaeba40e7cddc0cf54e6 (patch)
treee31560b0128290959afe5e0d666d2714cde84f28
parentbda1c0da81ac5f251ca7958fb0c20b4ea39eea70 (diff)
downloadpandoc-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.hs13
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