From 996e1ad1b34d0639d4c733b6dfb5e0786997e8d7 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 25 Nov 2008 00:09:02 +0000 Subject: Markdown reader: relax spacing rules for $$ in display math. Now space and newlines are allowed after the opening $$ and before the closing $$. However, the display math cannot contain an entirely blank line. Resolves Issue #105. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1494 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Readers/Markdown.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Text/Pandoc/Readers') diff --git a/Text/Pandoc/Readers/Markdown.hs b/Text/Pandoc/Readers/Markdown.hs index d49dd8e04..e9f19e817 100644 --- a/Text/Pandoc/Readers/Markdown.hs +++ b/Text/Pandoc/Readers/Markdown.hs @@ -864,7 +864,10 @@ math = (mathDisplay >>= return . Math DisplayMath) <|> (mathInline >>= return . Math InlineMath) mathDisplay :: GenParser Char ParserState String -mathDisplay = try $ char '$' >> mathInline >>~ char '$' >>~ notFollowedBy digit +mathDisplay = try $ do + failIfStrict + string "$$" + many1Till (noneOf "\n" <|> (newline >>~ notFollowedBy' blankline)) (try $ string "$$") mathInline :: GenParser Char ParserState String mathInline = try $ do -- cgit v1.2.3