Skip to content

Commit

Permalink
Stop linking images to new tab
Browse files Browse the repository at this point in the history
This fixes one of our [accessibility issues][1]. Specifically, it will
prevent images to link to new tabs without telling the user, which fails
[WCAG 2.1 success criterion 2.4.4 Link Purpose (in context)][2].

[1]: https://docs.google.com/spreadsheets/d/1s53eGMBj2hdTVLRitwi673R-_uERWh0kOxOp9QsOVg0
[2]: https://www.w3.org/TR/UNDERSTANDING-WCAG20/navigation-mechanisms-refs.html

Trello card: https://trello.com/c/vv0OR35g/630-march-update-tech-docs-template
  • Loading branch information
Alan Gabbianelli committed Feb 25, 2021
1 parent 2ebf6af commit a284b12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/govuk_tech_docs/tech_docs_html_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def header(text, level)
end

def image(link, *args)
%(<a href="#{link}" target="_blank" rel="noopener noreferrer">#{super}</a>)
%(<a href="#{link}" rel="noopener noreferrer">#{super}</a>)
end

def table(header, body)
Expand Down

0 comments on commit a284b12

Please sign in to comment.