You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
863 B
HTML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{{- .Page.Scratch.Add "urls" (slice .Destination) -}}{{- $t := .Text -}}{{- $sup := "" -}}{{- if and (strings.HasPrefix .Destination "{") (.Destination | strings.Count "}") -}}{{- range first 1 (split .Destination "}") -}}{{- range $frmt := (split (substr . 1) ",") -}}{{- if eq $frmt "sc" -}}<span class="smallcaps">{{- $t -}}</span>{{- end -}}{{- end -}}{{- end -}}{{- else }}{{- if strings.HasPrefix .Destination "http" -}}{{- $sup = "www" -}}{{- end -}}{{- if strings.HasPrefix .Destination "#" -}}{{- $sup = "§" -}}{{- end -}}<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ else if strings.HasPrefix .Destination "#"}}class="anchorz"{{ end }}><span class="sup" style="font-size:0.7em">{{- $sup -}}</span>{{ .Text | safeHTML }}</a>{{- end -}}