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:
Diffstat (limited to 'lib/banzai/filter/upload_link_filter.rb')
-rw-r--r--lib/banzai/filter/upload_link_filter.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/banzai/filter/upload_link_filter.rb b/lib/banzai/filter/upload_link_filter.rb
index 762371e1418..ceb7547a85d 100644
--- a/lib/banzai/filter/upload_link_filter.rb
+++ b/lib/banzai/filter/upload_link_filter.rb
@@ -15,8 +15,16 @@ module Banzai
def call
return doc if context[:system_note]
- linkable_attributes.each do |attr|
- process_link_to_upload_attr(attr)
+ if Feature.enabled?(:optimize_linkable_attributes, project, default_enabled: :yaml)
+ # We exclude processed upload links from the linkable attributes to
+ # prevent further modifications by RepositoryLinkFilter
+ linkable_attributes.reject! do |attr|
+ process_link_to_upload_attr(attr)
+ end
+ else
+ linkable_attributes.each do |attr|
+ process_link_to_upload_attr(attr)
+ end
end
doc