From a9f3abc653bc7c0cb320056e31bb569652e03321 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 9 Sep 2013 11:19:37 -0700 Subject: Markdown: don't parse citation right after alphanumeric. An `@` after an alphanumeric is probably an email address. --- src/Text/Pandoc/Readers/Markdown.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Text') 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 -- cgit v1.2.3