#2995 Don't treat @ in the middle of words as a mention
Merged by pingou. Opened by adamwill.
adamwill/pagure fix-mention-links  into  master

Download 2995.patch

If there's a user called 'example', then any occurence of the
string @example followed by a non-word character is treated
as a mention. This is not how we handle this for anything else
(e.g. issue or PR links) and has some obvious weird effects...
like the string someone@example.com is treated as a mention
of the user @example. So, let's not do that any more (by using
the same negative lookbehind we use for other things).

Also, drop the leading space from the text definition used in
the pattern's handleMatch(). The regex doesn't capture any
character before the @ and has not done for a long time, if it
ever did, so this is just wrong. If you look at the raw page
source of any Pagure page with an @mention in it, you can see
that there's a bogus extra space before the @ due to this,
though it seems that browsers (at least Firefox) strip it when
rendering the HTML.

Signed-off-by: Adam Williamson awilliam@redhat.com

Do you want these promised 50 lines of comment above the regex? :)

rebased onto 53d919f8c14c6a02becfe13c01ad2b4260efdb38

ask and ye shall receive!

Pull-Request has been merged by pingou

Metadata