aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-11-02 22:50:18 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-11-02 22:50:18 -0700
commitd18d9623b1d5bed5c92ea665dbd24c0a572d356c (patch)
treedccb007b130b337020daedb1e396e25e6d3a9f22
parent65129f33fdb469ede372560d0b39f07343c9c1b3 (diff)
downloadpandoc-d18d9623b1d5bed5c92ea665dbd24c0a572d356c.tar.gz
Roff reader: conditionals: allow .\} to end group.
-rw-r--r--src/Text/Pandoc/Readers/Roff.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Roff.hs b/src/Text/Pandoc/Readers/Roff.hs
index 179394e55..2bf2d070e 100644
--- a/src/Text/Pandoc/Readers/Roff.hs
+++ b/src/Text/Pandoc/Readers/Roff.hs
@@ -513,9 +513,9 @@ lexConditional mname = do
skipMany spacetab
st <- getState -- save state, so we can reset it
ifPart <- lexGroup <|> ((try (char '\\' >> newline)) >> manToken)
- <|> do modifyState $ \st -> st{ afterConditional = True }
+ <|> do modifyState $ \s -> s{ afterConditional = True }
t <- manToken
- modifyState $ \st -> st{ afterConditional = False }
+ modifyState $ \s -> s{ afterConditional = False }
return t
case mbtest of
Nothing -> do
@@ -548,7 +548,8 @@ lexGroup = do
mconcat <$> manyTill manToken groupend
where
groupstart = try $ string "\\{\\" >> newline
- groupend = try $ string "\\}" >> eofline
+ groupend = try $ optional (char '.' >> many spacetab) >>
+ string "\\}" >> eofline
lexIncludeFile :: PandocMonad m => [Arg] -> RoffLexer m RoffTokens
lexIncludeFile args = do