diff options
| author | Emmanuel Ferdman <[email protected]> | 2025-11-04 10:42:27 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-11-04 09:42:27 +0100 |
| commit | b106dca0693a26b8f134bb8550fe6ea5a83f3346 (patch) | |
| tree | a8e916e66168ddb2e0b6420190a57932bd24aef1 /src | |
| parent | 74f583847fb108593101a34ed88a13005a2252fb (diff) | |
LaTeX reader: fix spurious paragraph breaks in math environments (#11265)
Previously, a math environment with extra space before the
`\end` would get rendered with a blank line, which LaTeX
treats as a paragraph break.
Signed-off-by: Emmanuel Ferdman <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/Math.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Math.hs b/src/Text/Pandoc/Readers/LaTeX/Math.hs index 1f4dc4f8c..f1491656e 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Math.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Math.hs @@ -21,7 +21,7 @@ import qualified Data.Sequence as Seq import Text.Pandoc.Readers.LaTeX.Parsing import Text.Pandoc.TeX import Text.Pandoc.Class -import Text.Pandoc.Shared (trimMath, stripTrailingNewlines) +import Text.Pandoc.Shared (trimMath, trimr) import Text.Pandoc.Parsing hiding (blankline, mathDisplay, mathInline, optional, space, spaces, withRaw, (<|>)) import Control.Applicative ((<|>), optional) @@ -82,7 +82,7 @@ mathEnv :: PandocMonad m => Text -> LP m Text mathEnv name = withMathMode $ do optional blankline res <- manyTill anyTok (end_ name) - return $ stripTrailingNewlines $ untokenize res + return $ trimr $ untokenize res inlineEnvironment :: PandocMonad m => LP m Inlines inlineEnvironment = try $ do |
