summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-04-22 17:02:29 +0200
committerJames Lopez <james@jameslopez.es>2016-04-22 17:02:29 +0200
commitb18bd9c85f0d925aaa6ecf531673958bd97082fc (patch)
treeeea201c9c521ad35592774b773d6741fd6e43f92 /lib
parenta0ede57dd68e16eb030da388bcfd130eed127494 (diff)
parenta600b4b1c08c374e336cbd4226d2ff77c8ff9cca (diff)
downloadgitlab-ce-b18bd9c85f0d925aaa6ecf531673958bd97082fc.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into feature/project-export-ui-experimental
Diffstat (limited to 'lib')
-rw-r--r--lib/banzai/filter/external_link_filter.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/banzai/filter/external_link_filter.rb b/lib/banzai/filter/external_link_filter.rb
index d179bea181e..38c4219518e 100644
--- a/lib/banzai/filter/external_link_filter.rb
+++ b/lib/banzai/filter/external_link_filter.rb
@@ -1,7 +1,6 @@
module Banzai
module Filter
- # HTML Filter to add a `rel="nofollow"` attribute to external links
- #
+ # HTML Filter to modify the attributes of external links
class ExternalLinkFilter < HTML::Pipeline::Filter
def call
doc.search('a').each do |node|
@@ -15,7 +14,7 @@ module Banzai
# Skip internal links
next if link.start_with?(internal_url)
- node.set_attribute('rel', 'nofollow')
+ node.set_attribute('rel', 'nofollow noreferrer')
end
doc