Skip to content

Commit 27248bc

Browse files
committed
fix: Mark tel: links as safe
By default, Hugo only allows using `http:`, `https:`, and `mailto:`. URLs using other schemes are replaced with `#ZgotmplZ`. To allow using `tel:`, we have to declare it as safe using `| safeURL`. This marks every URL as safe which should be fine, since all content inside the repo is trusted. See https://gohugo.io/functions/safe/url/ for more info. Closes #185
1 parent 23ba728 commit 27248bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

layouts/_default/_markup/render-link.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
{{- if strings.HasPrefix $url "http" -}}
33
{{ partial "link" . }}
44
{{- else -}}
5-
<a href="{{ $url }}">{{ .Text }}</a>
5+
<a href="{{ $url | safeURL }}">{{ .Text }}</a>
66
{{- end -}}

0 commit comments

Comments
 (0)