fix: fix formatting on code links (#316)

This commit is contained in:
Robert Kaussow 2022-02-03 11:42:26 +01:00 committed by GitHub
parent 30d3c64c41
commit 4f3d48c1d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 3 deletions

View file

@ -1,8 +1,14 @@
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
{{- $code := hasPrefix .Text "<code" -}}
<a
class="gdoc-markdown__link{{ if $raw }}--raw{{ end }}"
class="gdoc-markdown__link{{ if $raw -}}
--raw
{{- else if $code -}}
--code
{{- end }}"
href="{{ .Destination | safeURL }}"
{{ with .Title }}title="{{ . }}"{{ end }}
>{{ .Text | safeHTML }}</a
>
{{- .Text | safeHTML -}}
</a>
{{- /* Drop trailing newlines */ -}}