Skip to content

Commit e01ada9

Browse files
zusorioMoritzWeber0
andcommitted
fix: Mark tel: links as safe (#189)
## Description 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 <!-- Add a short description here / Eine kurze Beschreibung hier einfügen --> ## Checklist <!-- Check fields with: [x] / Abhaken von Punkten: [x] --> - [x] Check the License of new pictures (non-commercial use without attribution) <!-- Die Lizenz neuer Bilder geprüft (nicht-kommerzielle Nutzung ohne Namensnennung) --> The content was modified in the following languages: <!-- Der Inhalt wurde für die folgenden Sprachen angepasst --> - [ ] English - [ ] German --------- Co-authored-by: Moritz Weber <kontakt@moritz-weber.net>
1 parent 23ba728 commit e01ada9

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)