get rif off extra spaces in smallcaps render-link...

master
Marcell Mars 3 years ago
parent a56c9e96fa
commit ec8499d071

@ -1,13 +1 @@
{{ .Page.Scratch.Add "urls" (slice .Destination) }}
{{ $t := .Text }}
{{- 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 -}}
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}><span class="sup">www</span><i>{{ .Text | safeHTML }}</i></a>
{{ end }}
{{- .Page.Scratch.Add "urls" (slice .Destination) -}}{{- $t := .Text -}}{{- 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 -}}<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}><span class="sup">www</span><i>{{ .Text | safeHTML }}</i></a>{{- end -}}

Loading…
Cancel
Save