diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-11-25 00:09:02 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-11-25 00:09:02 +0000 |
commit | 996e1ad1b34d0639d4c733b6dfb5e0786997e8d7 (patch) | |
tree | d7591c4bea361beeab8c33361a56767908505e1a /Text/Pandoc/Readers | |
parent | cf8b8fc4dd765c5fddddc0a9b3221cbd9d5dc64f (diff) | |
download | pandoc-996e1ad1b34d0639d4c733b6dfb5e0786997e8d7.tar.gz |
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
Diffstat (limited to 'Text/Pandoc/Readers')
-rw-r--r-- | Text/Pandoc/Readers/Markdown.hs | 5 |
1 files changed, 4 insertions, 1 deletions
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 |