aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Roff.hs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/Roff.hs b/src/Text/Pandoc/Readers/Roff.hs
index 183580fce..c12f6df83 100644
--- a/src/Text/Pandoc/Readers/Roff.hs
+++ b/src/Text/Pandoc/Readers/Roff.hs
@@ -271,9 +271,7 @@ escFontSize = do
escFont :: PandocMonad m => RoffLexer m [LinePart]
escFont = do
font <- choice
- [ char 'S' >> return defaultFontSpec
- , digit >> return defaultFontSpec
- , char '(' >> anyChar >> anyChar >> return defaultFontSpec
+ [ digit >> return defaultFontSpec
, digit >> return defaultFontSpec
, ($ defaultFontSpec) <$> letterFontKind
, lettersFont
@@ -284,10 +282,8 @@ escFont = do
lettersFont :: PandocMonad m => RoffLexer m FontSpec
lettersFont = try $ do
- char '['
- fs <- many letterFontKind
- skipMany letter
- char ']'
+ fs <- (char '[' *> many letterFontKind <* char ']')
+ <|> (char '(' *> count 2 letterFontKind)
if null fs
then prevFont <$> getState
else return $ foldr ($) defaultFontSpec fs
@@ -298,6 +294,7 @@ letterFontKind = choice [
, oneOf ['I','i'] >> return (\fs -> fs { fontItalic = True })
, oneOf ['C','c'] >> return (\fs -> fs { fontMonospace = True })
, oneOf ['P','p','R','r'] >> return id
+ , letter >> return id -- L, S, etc.
]