From 74221a0ccbd42d41b4e2535c84ae8a42050c1020 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 7 Sep 2024 08:39:09 -0700 Subject: [PATCH] LaTeX reader: math environments don't have bracketed options. We were checking for these, and that caused problems if the math began with `[`. Closes #10160. --- src/Text/Pandoc/Readers/LaTeX/Math.hs | 1 - test/command/10160.md | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/command/10160.md diff --git a/src/Text/Pandoc/Readers/LaTeX/Math.hs b/src/Text/Pandoc/Readers/LaTeX/Math.hs index 5a943e22ca2d..44de688d5e53 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Math.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Math.hs @@ -70,7 +70,6 @@ mathEnvWith f innerEnv name = f . mathDisplay . inner <$> mathEnv name mathEnv :: PandocMonad m => Text -> LP m Text mathEnv name = do - skipopts optional blankline res <- manyTill anyTok (end_ name) return $ stripTrailingNewlines $ untokenize res diff --git a/test/command/10160.md b/test/command/10160.md new file mode 100644 index 000000000000..fa3e97cd56a7 --- /dev/null +++ b/test/command/10160.md @@ -0,0 +1,11 @@ +``` +% pandoc -f latex -t native +\begin{equation} + [0,1) +\end{equation} + +\begin{table}[h] +\end{table} +^D +[ Para [ Math DisplayMath "[0,1)" ] ] +```