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