diff options
author | John MacFarlane <jgm@berkeley.edu> | 2013-09-09 11:19:37 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2013-09-09 11:19:37 -0700 |
commit | a9f3abc653bc7c0cb320056e31bb569652e03321 (patch) | |
tree | 2840371fb154b92283f2b2145e656ca9bf9dfdb6 /src/Text | |
parent | 4381c37b100a4cfd14020458e6b4e340a02b851e (diff) | |
download | pandoc-a9f3abc653bc7c0cb320056e31bb569652e03321.tar.gz |
Markdown: don't parse citation right after alphanumeric.
An `@` after an alphanumeric is probably an email address.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 5 |
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 |