diff --git a/app/components/layout/footer_component.html.erb b/app/components/layout/footer_component.html.erb index 0122798b1..3aeb2a9ca 100644 --- a/app/components/layout/footer_component.html.erb +++ b/app/components/layout/footer_component.html.erb @@ -8,7 +8,8 @@
<%= sanitize(t("layouts.footer.description", open_source: open_source_link, - consul: repository_link)) %> + consul: repository_link), + attributes: allowed_link_attributes) %>
diff --git a/app/components/layout/footer_component.rb b/app/components/layout/footer_component.rb index c81d102ac..58278899b 100644 --- a/app/components/layout/footer_component.rb +++ b/app/components/layout/footer_component.rb @@ -14,4 +14,8 @@ class Layout::FooterComponent < ApplicationComponent def repository_link link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), rel: "nofollow") end + + def allowed_link_attributes + self.class.sanitized_allowed_attributes + ["rel"] + end end diff --git a/spec/components/layout/footer_component_spec.rb b/spec/components/layout/footer_component_spec.rb index 83b509506..d44e52e01 100644 --- a/spec/components/layout/footer_component_spec.rb +++ b/spec/components/layout/footer_component_spec.rb @@ -6,6 +6,7 @@ describe Layout::FooterComponent do render_inline Layout::FooterComponent.new page.find(".info") do |info| + expect(info).to have_css "a[rel=nofollow]", count: 2 expect(info).not_to have_css "a[target]" end end