]> source.dussan.org Git - redmine.git/commitdiff
Revert r22446 and r22447 (#39553).
authorMarius Balteanu <marius.balteanu@zitec.com>
Thu, 16 Nov 2023 22:16:33 +0000 (22:16 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Thu, 16 Nov 2023 22:16:33 +0000 (22:16 +0000)
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22448 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/acts/mentionable.rb
test/unit/lib/redmine/acts/mentionable_test.rb

index 24adf04b3f5a0c296f53c8e24e0ce5b859ed8af8..c7b0c065545ea0aa59d75ced5355029b6d4b426b 100644 (file)
@@ -98,10 +98,12 @@ module Redmine
           @([A-Za-z0-9_\-@\.]*?)
           (?=
             (?=[[:punct:]][^A-Za-z0-9_\/])|
+            ,|
+            \.+$|
             \s|
-            [[:punct:]]?
-            $
-          )
+            \]|
+            <|
+            $)
         /ix
       end
     end
index baf505d986c98229fd3ce833cc67b8b5bf0f7376..91fef8eb2da895f8ae712630d5a4a7cc991c885f 100644 (file)
@@ -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