@@ -693,13 +693,12 @@ emailAddress = try $ toResult <$> mailbox <*> (char '@' *> domain)
693 mailbox = intercalate "." <$> (emailWord `sepBy1'` dot)
693 mailbox = intercalate "." <$> (emailWord `sepBy1'` dot)
694 domain = intercalate "." <$> (subdomain `sepBy1'` dot)
694 domain = intercalate "." <$> (subdomain `sepBy1'` dot)
695 dot = char '.'
695 dot = char '.'
696− subdomain = many1 $ alphaNum <|> innerPunct
696+ subdomain = many1 $ alphaNum <|> innerPunct (=='-')
697 -- this excludes some valid email addresses, since an
697 -- this excludes some valid email addresses, since an
698 -- email could contain e.g. '__', but gives better results
698 -- email could contain e.g. '__', but gives better results
699 -- for our purposes, when combined with markdown parsing:
699 -- for our purposes, when combined with markdown parsing:
700− innerPunct = try (satisfy (\c -> isEmailPunct c || c == '@')
700+ innerPunct f = try (satisfy f
701− <* notFollowedBy space
701+ <* notFollowedBy (satisfy (not . isAlphaNum)))
702− <* notFollowedBy (satisfy isPunctuation))
703 -- technically an email address could begin with a symbol,
702 -- technically an email address could begin with a symbol,
704 -- but allowing this creates too many problems.
703 -- but allowing this creates too many problems.
705 -- See e.g. https://github.com/jgm/pandoc/issues/2940
704 -- See e.g. https://github.com/jgm/pandoc/issues/2940