2021-02-21 21:16:11 +01:00
|
|
|
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
|
2022-02-02 22:27:10 +01:00
|
|
|
{{- $code := hasPrefix .Text "<code" -}}
|
2021-12-30 15:55:55 +01:00
|
|
|
<a
|
2022-07-11 16:04:05 +02:00
|
|
|
class="gblog-markdown__link{{- if $raw -}}
|
2022-02-02 22:27:10 +01:00
|
|
|
--raw
|
|
|
|
{{- else if $code -}}
|
|
|
|
--code
|
|
|
|
{{- end }}"
|
2021-12-30 15:55:55 +01:00
|
|
|
href="{{ .Destination | safeURL }}"
|
2022-07-11 16:04:05 +02:00
|
|
|
{{- with .Title }}{{ printf "title=\"%s\"" . | safeHTMLAttr }}{{- end }}
|
2021-12-30 15:55:55 +01:00
|
|
|
>
|
2022-02-02 22:27:10 +01:00
|
|
|
{{- .Text | safeHTML -}}
|
|
|
|
</a>
|
2021-05-23 14:57:55 +02:00
|
|
|
{{- /* Drop trailing newlines */ -}}
|