mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-04 20:30:44 +00:00
15 lines
404 B
HTML
15 lines
404 B
HTML
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
|
|
{{- $code := hasPrefix .Text "<code" -}}
|
|
<a
|
|
class="gblog-markdown__link{{- if $raw -}}
|
|
--raw
|
|
{{- else if $code -}}
|
|
--code
|
|
{{- end }}"
|
|
href="{{ .Destination | safeURL }}"
|
|
{{- with .Title }}{{ printf "title=\"%s\"" . | safeHTMLAttr }}{{- end }}
|
|
>
|
|
{{- .Text | safeHTML -}}
|
|
</a>
|
|
{{- /* Drop trailing newlines */ -}}
|