From 068559e9dec4dc67c58e5f804417126bf1cc792a Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Thu, 16 Nov 2023 22:16:33 +0000 Subject: [PATCH] Revert r22446 and r22447 (#39553). git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22448 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/acts/mentionable.rb | 8 +++++--- test/unit/lib/redmine/acts/mentionable_test.rb | 7 ++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/redmine/acts/mentionable.rb b/lib/redmine/acts/mentionable.rb index 24adf04b3..c7b0c0655 100644 --- a/lib/redmine/acts/mentionable.rb +++ b/lib/redmine/acts/mentionable.rb @@ -98,10 +98,12 @@ module Redmine @([A-Za-z0-9_\-@\.]*?) (?= (?=[[:punct:]][^A-Za-z0-9_\/])| + ,| + \.+$| \s| - [[:punct:]]? - $ - ) + \]| + <| + $) /ix end end diff --git a/test/unit/lib/redmine/acts/mentionable_test.rb b/test/unit/lib/redmine/acts/mentionable_test.rb index baf505d98..91fef8eb2 100644 --- a/test/unit/lib/redmine/acts/mentionable_test.rb +++ b/test/unit/lib/redmine/acts/mentionable_test.rb @@ -29,12 +29,9 @@ class Redmine::Acts::MentionableTest < ActiveSupport::TestCase :issues def test_mentioned_users_with_user_mention - to_test = %w(@dlopper @dlopper! @dlopper? @dlopper. @dlopper,) + issue = Issue.generate!(project_id: 1, description: '@dlopper') - to_test.each do |item| - issue = Issue.generate!(project_id: 1, description: item) - assert_equal [User.find(3)], issue.mentioned_users - end + assert_equal [User.find(3)], issue.mentioned_users end def test_mentioned_users_with_user_mention_having_mail_as_login -- 2.39.5