Try to avoid rewriting message links using the postgr.es syntax
authorMagnus Hagander <magnus@hagander.net>
Thu, 6 Apr 2017 16:09:18 +0000 (18:09 +0200)
committerMagnus Hagander <magnus@hagander.net>
Thu, 6 Apr 2017 16:09:18 +0000 (18:09 +0200)
django/archives/mailarchives/templatetags/pgfilters.py

index 9f971192854e806664169c98e0f6262f3f3d449b..6dd68a9aa33d8bb8d24f553753064e461990fcf1 100644 (file)
@@ -20,10 +20,11 @@ def hidemail(value):
 # mailing list archives:
 #
 #  https://www.postgresql.org/message-id/1asd21das@mail.gmail.com
+#  https://postgr.es/m/1asd21das@mail.gmail.com
 #
 # Those are not email addresses, so ignore them. The links won't work if they
 # are mangled.
-_re_mail = re.compile('(/message-id/)?[^()<>@,;:\/\s"\'&|]+@[^()<>@,;:\/\s"\'&|]+')
+_re_mail = re.compile('(/m(essage-id)?/)?[^()<>@,;:\/\s"\'&|]+@[^()<>@,;:\/\s"\'&|]+')
 def _rewrite_email_match(match):
        if match.group(1):
                return match.group(0)   # was preceded by /message-id/