fix: fix formatting on code links (#316)
This commit is contained in:
parent
30d3c64c41
commit
4f3d48c1d9
4 changed files with 28 additions and 3 deletions
|
@ -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 */ -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue