mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Prefer \A and \z over ^ and $ in regexes (#19936)
This commit is contained in:
committed by
GitHub
parent
f7907a3645
commit
666536cbd1
@@ -102,7 +102,7 @@ module PrettyText
|
||||
# TODO (martin) Remove this when everything is using hashtag_lookup
|
||||
# after enable_experimental_hashtag_autocomplete is default.
|
||||
def category_tag_hashtag_lookup(text)
|
||||
is_tag = text =~ /#{TAG_HASHTAG_POSTFIX}$/
|
||||
is_tag = text =~ /#{TAG_HASHTAG_POSTFIX}\z/
|
||||
|
||||
if !is_tag && category = Category.query_from_hashtag_slug(text)
|
||||
[category.url, text]
|
||||
|
||||
Reference in New Issue
Block a user