diff --git a/modules/wowchemy/layouts/partials/components/page_sharer.html b/modules/wowchemy/layouts/partials/components/page_sharer.html index c0359491..79f4d7e0 100644 --- a/modules/wowchemy/layouts/partials/components/page_sharer.html +++ b/modules/wowchemy/layouts/partials/components/page_sharer.html @@ -7,8 +7,14 @@ {{ if in (slice "fab" "fas" "far" "fal") $pack }} {{ $pack_prefix = "fa" }} {{ end }} - {{ $link := replace .url "{url}" ($.Permalink | htmlEscape) }} - {{ $link = replace $link "{title}" ($.Title | htmlEscape) }} + {{/* Utilise `urlquery` over `htmlEscape` to encode sharing URL */}} + {{/* See https://github.com/wowchemy/wowchemy-hugo-themes/pull/2726 */}} + {{ $link := replace .url "{url}" ($.Permalink | urlquery) }} + {{ $link = replace $link "{title}" ($.Title | urlquery) }} + {{/* Workaround `urlquery` encoding for mailto as `urlquery` encodes `+` as `%2B` and ` ` (space) as `+` */}} + {{ if eq (urls.Parse $link).Scheme "mailto" }} + {{ $link = replace $link "+" "%20" }} + {{ end }}