From fc78be1140532dcd7dc4ef614ac753cca5cf8b1e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Jan 2020 08:43:51 -0800 Subject: LaTeX reader: improve parsing of raw environments. If parsing fails in a raw environment (e.g. due to special characters like unescaped `_`), try again as a verbatim environment, which is less sensitive to special characters. This allows us to capture special environments that change catcodes as raw tex when `-f latex+raw_tex` is used. Closes #6034. --- src/Text/Pandoc/Readers/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index adb66d54a..bfade7284 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1942,7 +1942,7 @@ environment = try $ do if M.member name (inlineEnvironments :: M.Map Text (LP PandocPure Inlines)) then mzero - else rawEnv name + else rawEnv name <|> rawVerbEnv name env :: PandocMonad m => Text -> LP m a -> LP m a env name p = p <* end_ name -- cgit v1.2.3