From b263f383040618ff991912512ccd396b83d43da5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 13 Jun 2022 23:14:51 -0600 Subject: LaTeX reader: improve mathEnvWith. When converting e.g. an align environment to an aligned environment inside a Math element, we need to include a newline before the `\end{aligned}`, since the previous line might end in a comment. Closes #8122. --- src/Text/Pandoc/Readers/LaTeX/Math.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/LaTeX/Math.hs b/src/Text/Pandoc/Readers/LaTeX/Math.hs index 9f3d6fe53..92f41910b 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Math.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Math.hs @@ -65,7 +65,7 @@ mathEnvWith f innerEnv name = f . mathDisplay . inner <$> mathEnv name where inner x = case innerEnv of Nothing -> x Just y -> "\\begin{" <> y <> "}\n" <> x <> - "\\end{" <> y <> "}" + "\n\\end{" <> y <> "}" mathEnv :: PandocMonad m => Text -> LP m Text mathEnv name = do -- cgit v1.2.3