0
0
Fork 0

Fix wrongful matching of last period in extended usernames

Fix anchor tags in some wikipedia URLs being matches as a hashtag
This commit is contained in:
Eugen Rochko 2017-03-05 18:08:19 +01:00
parent 5f4e402204
commit 4fb95c91fb
4 changed files with 20 additions and 3 deletions

View file

@ -3,7 +3,7 @@
class Tag < ApplicationRecord
has_and_belongs_to_many :statuses
HASHTAG_RE = /(?:^|[^\/\w])#([[:word:]_]*[[:alpha:]_][[:word:]_]*)/i
HASHTAG_RE = /(?:^|[^\/\)\w])#([[:word:]_]*[[:alpha:]_][[:word:]_]*)/i
validates :name, presence: true, uniqueness: true