Fix "rel" attribute in footer description links
We were accidentally filtering this attribute when sanitizing the text
since commit 928312e21.
This commit is contained in:
@@ -8,7 +8,8 @@
|
|||||||
<p class="info">
|
<p class="info">
|
||||||
<%= sanitize(t("layouts.footer.description",
|
<%= sanitize(t("layouts.footer.description",
|
||||||
open_source: open_source_link,
|
open_source: open_source_link,
|
||||||
consul: repository_link)) %>
|
consul: repository_link),
|
||||||
|
attributes: allowed_link_attributes) %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -14,4 +14,8 @@ class Layout::FooterComponent < ApplicationComponent
|
|||||||
def repository_link
|
def repository_link
|
||||||
link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), rel: "nofollow")
|
link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), rel: "nofollow")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def allowed_link_attributes
|
||||||
|
self.class.sanitized_allowed_attributes + ["rel"]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ describe Layout::FooterComponent do
|
|||||||
render_inline Layout::FooterComponent.new
|
render_inline Layout::FooterComponent.new
|
||||||
|
|
||||||
page.find(".info") do |info|
|
page.find(".info") do |info|
|
||||||
|
expect(info).to have_css "a[rel=nofollow]", count: 2
|
||||||
expect(info).not_to have_css "a[target]"
|
expect(info).not_to have_css "a[target]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user