@@ -864,7 +864,10 @@ math = (mathDisplay >>= return . Math DisplayMath)
864 <|> (mathInline >>= return . Math InlineMath)
864 <|> (mathInline >>= return . Math InlineMath)
866mathDisplay :: GenParser Char ParserState String
866mathDisplay :: GenParser Char ParserState String
867−mathDisplay = try $ char '$' >> mathInline >>~ char '$' >>~ notFollowedBy digit
867+mathDisplay = try $ do
870+ many1Till (noneOf "\n" <|> (newline >>~ notFollowedBy' blankline)) (try $ string "$$")
869mathInline :: GenParser Char ParserState String
872mathInline :: GenParser Char ParserState String
870mathInline = try $ do
873mathInline = try $ do