]> cat aescling's git repositories - mastodon.git/commitdiff
Fix local mention regex so it works on newlines in HTML (with a preceding tag)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 10 Sep 2016 08:19:50 +0000 (10:19 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 10 Sep 2016 08:19:50 +0000 (10:19 +0200)
app/models/account.rb

index 8792b90ea790ac5f5a13257960a9ad89448806b9..1767f72e2e6977b98dbddf1bab2aa79276df30be 100644 (file)
@@ -35,7 +35,7 @@ class Account < ApplicationRecord
 
   has_many :media_attachments, dependent: :destroy
 
-  MENTION_RE = /(?:^|\s|\.)@([a-z0-9_]+(?:@[a-z0-9\.\-]+)?)/i
+  MENTION_RE = /(?:^|\s|\.|>)@([a-z0-9_]+(?:@[a-z0-9\.\-]+)?)/i
 
   def follow!(other_account)
     self.active_relationships.where(target_account: other_account).first_or_create!(target_account: other_account)