2021-02-21 21:56:26 +01:00
|
|
|
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
|
2022-02-03 11:42:26 +01:00
|
|
|
{{- $code := hasPrefix .Text "<code" -}}
|
2022-01-06 13:58:10 +01:00
|
|
|
<a
|
2022-02-03 11:42:26 +01:00
|
|
|
class="gdoc-markdown__link{{ if $raw -}}
|
|
|
|
--raw
|
|
|
|
{{- else if $code -}}
|
|
|
|
--code
|
|
|
|
{{- end }}"
|
2022-01-06 13:58:10 +01:00
|
|
|
href="{{ .Destination | safeURL }}"
|
2022-07-11 20:46:01 +02:00
|
|
|
{{- with .Title }}{{ printf "title=\"%s\"" . | safeHTMLAttr }}{{- end }}
|
2022-01-06 13:58:10 +01:00
|
|
|
>
|
2022-02-03 11:42:26 +01:00
|
|
|
{{- .Text | safeHTML -}}
|
|
|
|
</a>
|
2021-02-24 16:37:12 +01:00
|
|
|
{{- /* Drop trailing newlines */ -}}
|