Merge pull request #87 from nunocoracao/86-external-links-should-open-in-a-new-tab-by-default

make external links open by default on a new tab
This commit is contained in:
Nuno Coração 2022-10-09 12:23:07 +01:00 committed by GitHub
commit 27412dbb1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,3 @@
<a href="{{ .Destination | safeURL }}" {{ with .Title}} title="{{ . }}"{{ end }} {{ if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }} target="_blank"{{ end }}>
{{ .Text | safeHTML }}
</a>