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
commit996e1ad1b34d0639d4c733b6dfb5e0786997e8d7
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>
dateTue 25 Nov 2008, 00:09 (18 years ago)
parentcf8b8fc
Text/Pandoc/Readers/Markdown.hs+4−1
@@ -864,7 +864,10 @@ math = (mathDisplay >>= return . Math DisplayMath)
864864 <|> (mathInline >>= return . Math InlineMath)
865865
866866mathDisplay :: GenParser Char ParserState String
867−mathDisplay = try $ char '$' >> mathInline >>~ char '$' >>~ notFollowedBy digit
867+mathDisplay = try $ do
868+ failIfStrict
869+ string "$$"
870+ many1Till (noneOf "\n" <|> (newline >>~ notFollowedBy' blankline)) (try $ string "$$")
868871
869872mathInline :: GenParser Char ParserState String
870873mathInline = try $ do