Skip to content

Commit

Permalink
#45 Escape alt and title tags properly
Browse files Browse the repository at this point in the history
Signed-off-by: James Hunt <10615884+thetwopct@users.noreply.github.com>

Signed-off-by: James Hunt <10615884+thetwopct@users.noreply.github.com>
  • Loading branch information
thetwopct committed May 21, 2024
1 parent e7fae65 commit 1a3b099
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<div class="footer__logo-social-wrapper">
{{ with .Site.Params.logo_on_black }}
<a class="logo-link" href="{{ "/" | absLangURL }}">
<img loading="lazy" class="logo" width="150" height="40" src="{{ . | absURL }}" alt="{{ $.Site.Title }}"></a>
<img loading="lazy" class="logo" width="150" height="40" src="{{ . | absURL }}" alt="{{ $.Site.Title | safeHTMLAttr }}"></a>
{{ end }}

{{- partial "footer/social-links.html" . -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer/social-links.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{{ range $validLinks }}
<li>
<a href="{{ .value }}" title="{{ i18n "social_link_title" (dict "SiteTitle" $siteTitle "Network" (humanize .key)) | default (printf "%s on %s" $siteTitle (humanize .key)) }}">
<img loading="lazy" width="31" height="31" src="{{ printf "/img/social-icons/%s.svg" .key }}" alt="{{ (humanize .key) }} Icon">
<img loading="lazy" width="31" height="31" src="{{ printf "/img/social-icons/%s.svg" .key }}" alt="{{ (humanize .key) | safeHTMLAttr }} icon">
</a>
</li>
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{{ with .Site.Params.logo_on_white }}
<a class="logo-link" href="{{ "/" | absLangURL }}">
<img class="logo" width="150" height="40" src="{{ . | absURL }}" alt="{{ $.Site.Title }}">
<img class="logo" width="150" height="40" src="{{ . | absURL }}" alt="{{ $.Site.Title | safeHTMLAttr }}">
</a>
{{ else }}
<a class="site-title-link" href="{{ "/" | absLangURL }}">
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/img.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
src="{{ $src }}"
width="{{ $width }}"
height="{{ $height }}"
alt="{{ $alt }}"
alt="{{ $alt | safeHTMLAttr }}"
loading="{{ $loading }}"
>
{{ if $caption}}
Expand Down

0 comments on commit 1a3b099

Please sign in to comment.