diff --git a/pagure/lib/notify.py b/pagure/lib/notify.py index 77f7c64..7670ad1 100644 --- a/pagure/lib/notify.py +++ b/pagure/lib/notify.py @@ -34,6 +34,7 @@ import flask import pagure.lib.query import pagure.lib.tasks_services from pagure.config import config as pagure_config +from pagure.pfmarkdown import MENTION_RE _log = logging.getLogger(__name__) @@ -233,8 +234,7 @@ def _add_mentioned_users(emails, comment): """ Check the comment to see if an user is mentioned in it and if so add this user to the list of people to notify. """ - mentio_re = r"@(\w+)" - for username in re.findall(mentio_re, comment): + for username in re.findall(MENTION_RE, comment): user = pagure.lib.query.search_user(flask.g.session, username=username) if user: emails.add(user.default_email) diff --git a/pagure/pfmarkdown.py b/pagure/pfmarkdown.py index b46f48f..47d49a5 100644 --- a/pagure/pfmarkdown.py +++ b/pagure/pfmarkdown.py @@ -52,7 +52,7 @@ except ImportError: # MENTION_RE regex). Note that it is a zero-length match - it does # not capture or consume any of the string - and it does not appear # as a group for the match object. -MENTION_RE = r"(?