From 2a90415ed28c02ed911a9942920bf770496cb0a0 Mon Sep 17 00:00:00 2001 From: Marius BALTEANU Date: Sun, 11 Apr 2021 10:30:09 +0300 Subject: [PATCH] Fix user mention using @ not working at the end of line --- app/helpers/application_helper.rb | 2 +- test/helpers/application_helper_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7c77a14df..25df205f8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1283,7 +1283,7 @@ module ApplicationHelper )| ( (?@) - (?[A-Za-z0-9_\-@\.]*) + (?[A-Za-z0-9_\-@\.]*?) ) ) (?= diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 106820999..730023443 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -521,6 +521,7 @@ class ApplicationHelperTest < Redmine::HelperTest 'user:JSMITH' => link_to_user(User.find_by_id(2)), 'user#2' => link_to_user(User.find_by_id(2)), '@jsmith' => link_to_user(User.find_by_id(2)), + '@jsmith.' => "#{link_to_user(User.find_by_id(2))}.", '@JSMITH' => link_to_user(User.find_by_id(2)), '@abcd@example.com' => link_to_user(User.find_by_id(u_email_id)), 'user:abcd@example.com' => link_to_user(User.find_by_id(u_email_id)), -- 2.22.0