aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-10-23 23:12:36 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2016-10-23 23:12:36 +0200
commitbf72a482ebf8483028f587fb538d35e2b18dade4 (patch)
treea98ab74ccd743eb5ddd298f8e3c1d35951b621cc /tests
parent738806112bc0ee1711c6f170361d382c7d4265e8 (diff)
downloadpandoc-bf72a482ebf8483028f587fb538d35e2b18dade4.tar.gz
Tighten up parsing of raw email addresses.
Technically `**@user` is a valid email address, but if we allow things like this, we get bad results in markdown flavors that autolink raw email addresses. (See #2940.) So we exclude a few valid email addresses in order to avoid these more common bad cases. Closes #2940.
Diffstat (limited to 'tests')
-rw-r--r--tests/Tests/Readers/Markdown.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Markdown.hs b/tests/Tests/Readers/Markdown.hs
index 099d75b62..e877b81ca 100644
--- a/tests/Tests/Readers/Markdown.hs
+++ b/tests/Tests/Readers/Markdown.hs
@@ -185,6 +185,11 @@ tests = [ testGroup "inline code"
"<\n\na>" =?>
para (text "<") <> para (text "a>")
]
+ , testGroup "raw email addresses"
+ [ test markdownGH "issue 2940" $
+ "**@user**" =?>
+ para (strong (text "@user"))
+ ]
, testGroup "emoji"
[ test markdownGH "emoji symbols" $
":smile: and :+1:" =?> para (text "😄 and 👍")