aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbenniekiss <[email protected]>2025-12-14 10:44:56 -0500
committerJohn MacFarlane <[email protected]>2025-12-14 16:46:31 +0100
commitdb9be758bc170e01cc0ce3af43a818edab8ea15f (patch)
tree03d8f0d3a76faaaf4652084660e1a95944c37f54 /src
parente8ed40ef01efdba315ec995c99da31a55bf55c57 (diff)
Markdown reader: fix parsing of inline math (`$...$`) (#11348)
Do not allow blank lines before closing `$` delimiter. This brings the parser in line with the documentation. Closes #11311.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Parsing/Math.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Parsing/Math.hs b/src/Text/Pandoc/Parsing/Math.hs
index fc8da73bd..a958d5b86 100644
--- a/src/Text/Pandoc/Parsing/Math.hs
+++ b/src/Text/Pandoc/Parsing/Math.hs
@@ -42,7 +42,7 @@ mathInlineWith op cl = try $ do
(try (string "text" >>
(("\\text" <>) <$> inBalancedBraces 0 ""))
<|> (\c -> T.pack ['\\',c]) <$> anyChar))
- <|> ("\n" <$ blankline <* notFollowedBy' blankline)
+ <|> ("\n" <$ blankline <* notFollowedBy' blankline <* notFollowedBy (char '$'))
<|> (T.pack <$> many1 spaceChar <* notFollowedBy (char '$'))
) (try $ textStr cl)
notFollowedBy digit -- to prevent capture of $5