git.iko.soy/typeable/pandoc
on master help sign in
Markdown: don't parse citation right after alphanumeric.

An `@` after an alphanumeric is probably an email address.

commita9f3abc653bc7c0cb320056e31bb569652e03321 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 9 Sep 2013, 11:19 (13 years ago) parent4381c37
1 file changed+5
src/Text/Pandoc/Readers/Markdown.hs+5
src/Text/Pandoc/Readers/Markdown.hs+5
@@ -1823,6 +1823,11 @@ normalCite = try $ do
18231823
18241824citeKey :: MarkdownParser (Bool, String)
18251825citeKey = try $ do
1826+ -- make sure we're not right after an alphanumeric,
1827+ -- since foo@bar.baz is probably an email address
1828+ lastStrPos <- stateLastStrPos <$> getState
1829+ pos <- getPosition
1830+ guard $ lastStrPos /= Just pos
18261831 suppress_author <- option False (char '-' >> return True)
18271832 char '@'
18281833 first <- letter