summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2013-09-09 11:19:37 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2013-09-09 11:19:37 -0700
commita9f3abc653bc7c0cb320056e31bb569652e03321 (patch)
tree2840371fb154b92283f2b2145e656ca9bf9dfdb6 /src
parent4381c37b100a4cfd14020458e6b4e340a02b851e (diff)
Markdown: don't parse citation right after alphanumeric.
An `@` after an alphanumeric is probably an email address.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 122db17de..9f2bc4447 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1823,6 +1823,11 @@ normalCite = try $ do
citeKey :: MarkdownParser (Bool, String)
citeKey = try $ do
+ -- make sure we're not right after an alphanumeric,
+ -- since foo@bar.baz is probably an email address
+ lastStrPos <- stateLastStrPos <$> getState
+ pos <- getPosition
+ guard $ lastStrPos /= Just pos
suppress_author <- option False (char '-' >> return True)
char '@'
first <- letter