git.iko.soy/typeable/pandoc
on master help sign in
Roff reader: conditionals: allow .\} to end group.
commitd18d9623b1d5bed5c92ea665dbd24c0a572d356c authorJohn MacFarlane <jgm@berkeley.edu> dateFri 2 Nov 2018, 22:50 (8 years ago) parent65129f3
1 file changed+4−3
src/Text/Pandoc/Readers/Roff.hs+4−3
src/Text/Pandoc/Readers/Roff.hs+4−3
@@ -513,9 +513,9 @@ lexConditional mname = do
513513 skipMany spacetab
514514 st <- getState -- save state, so we can reset it
515515 ifPart <- lexGroup <|> ((try (char '\\' >> newline)) >> manToken)
516− <|> do modifyState $ \st -> st{ afterConditional = True }
516+ <|> do modifyState $ \s -> s{ afterConditional = True }
517517 t <- manToken
518− modifyState $ \st -> st{ afterConditional = False }
518+ modifyState $ \s -> s{ afterConditional = False }
519519 return t
520520 case mbtest of
521521 Nothing -> do
@@ -548,7 +548,8 @@ lexGroup = do
548548 mconcat <$> manyTill manToken groupend
549549 where
550550 groupstart = try $ string "\\{\\" >> newline
551− groupend = try $ string "\\}" >> eofline
551+ groupend = try $ optional (char '.' >> many spacetab) >>
552+ string "\\}" >> eofline
552553
553554lexIncludeFile :: PandocMonad m => [Arg] -> RoffLexer m RoffTokens
554555lexIncludeFile args = do