Added a try that was needed for the commit fc78be1.
The intent of that commit was to parse unknown LaTeX
enivronments as verbatim if they can't be parsed normally,
avoiding crashes on environments that allow unescaped
underscores and the like. But the fix didn't completely
work: it worked for raw TeX in markdown but not when
reading LaTeX. This change fixes that.
See #6034. Closes #6093.
commite6399d162aedf2bfe2b183cd4c7310521dafe842
authorJohn MacFarlane <jgm@berkeley.edu>
dateTue 28 Jan 2020, 21:32 (7 years ago)
parent34eba44
src/Text/Pandoc/Readers/LaTeX.hs+1−1
@@ -1942,7 +1942,7 @@ environment = try $ do
19421942 if M.member name (inlineEnvironments
19431943 :: M.Map Text (LP PandocPure Inlines))
19441944 then mzero
1945− else rawEnv name <|> rawVerbEnv name
1945+ else try (rawEnv name) <|> rawVerbEnv name
19461946
19471947env :: PandocMonad m => Text -> LP m a -> LP m a
19481948env name p = p <* end_ name