Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-03-29 12:37:16 +0300
committerSean McGivern <sean@mcgivern.me.uk>2017-03-29 12:37:16 +0300
commit65cc277d64cb8d6e6faa74cf237fd28a9f9c525d (patch)
tree8488336c5168d65b695973e42cc088d9a812affe /lib/banzai
parent839183f2cbbed45bd2a8f8123bd01e2d2b509037 (diff)
parente06015379739ce6ee57318d35d18e274f4e930a6 (diff)
Merge branch 'make_user_mentions_case_insensitive' into 'master'
Make user mentions case-insensitive Closes #24493 See merge request !10285
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/user_reference_filter.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/banzai/filter/user_reference_filter.rb b/lib/banzai/filter/user_reference_filter.rb
index fe1f0923136..a798927823f 100644
--- a/lib/banzai/filter/user_reference_filter.rb
+++ b/lib/banzai/filter/user_reference_filter.rb
@@ -60,7 +60,7 @@ module Banzai
self.class.references_in(text) do |match, username|
if username == 'all' && !skip_project_check?
link_to_all(link_content: link_content)
- elsif namespace = namespaces[username]
+ elsif namespace = namespaces[username.downcase]
link_to_namespace(namespace, link_content: link_content) || match
else
match
@@ -74,7 +74,7 @@ module Banzai
# The keys of this Hash are the namespace paths, the values the
# corresponding Namespace objects.
def namespaces
- @namespaces ||= Namespace.where_full_path_in(usernames).index_by(&:full_path)
+ @namespaces ||= Namespace.where_full_path_in(usernames).index_by(&:full_path).transform_keys(&:downcase)
end
# Returns all usernames referenced in the current document.