Fix mentions regex to exclude usernames in Medium URLs
This commit is contained in:
parent
039e6f951c
commit
c38ad208c3
2 changed files with 25 additions and 1 deletions
|
@ -31,7 +31,7 @@ class Account < ActiveRecord::Base
|
|||
has_many :following, through: :active_relationships, source: :target_account
|
||||
has_many :followers, through: :passive_relationships, source: :account
|
||||
|
||||
MENTION_RE = /(?:^|\W)@([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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue