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/base_sanitization_filter.rb')
-rw-r--r--lib/banzai/filter/base_sanitization_filter.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/banzai/filter/base_sanitization_filter.rb b/lib/banzai/filter/base_sanitization_filter.rb
index c63453f94ca..7ea32c4b1e7 100644
--- a/lib/banzai/filter/base_sanitization_filter.rb
+++ b/lib/banzai/filter/base_sanitization_filter.rb
@@ -59,7 +59,11 @@ module Banzai
def remove_rel
lambda do |env|
if env[:node_name] == 'a'
- env[:node].remove_attribute('rel')
+ # we allow rel="license" to support the Rel-license microformat
+ # http://microformats.org/wiki/rel-license
+ unless env[:node].attribute('rel')&.value == 'license'
+ env[:node].remove_attribute('rel')
+ end
end
end
end