From db9be758bc170e01cc0ce3af43a818edab8ea15f Mon Sep 17 00:00:00 2001 From: benniekiss <63211101+benniekiss@users.noreply.github.com> Date: Sun, 14 Dec 2025 10:44:56 -0500 Subject: 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. --- src/Text/Pandoc/Parsing/Math.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3