Skip to content

Commit

Permalink
Update tech_docs_html_renderer.rb
Browse files Browse the repository at this point in the history
Rewrite alt text guard to be more exact
  • Loading branch information
tombye authored and huwd committed Oct 22, 2024
1 parent 66df4ad commit adc828b
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, title, alt_text)
if alt_text
if alt_text && !alt_text.strip.empty?
%(<a href="#{link}" rel="noopener noreferrer">#{super}</a>)
else
super
Expand Down

0 comments on commit adc828b

Please sign in to comment.