fix: prevend wrong formatting for linked images

This commit is contained in:
Robert Kaussow 2021-02-21 14:04:40 +01:00
parent 3f79ebfbf7
commit 0d80589019
No known key found for this signature in database
GPG key ID: 65362AE74AF98B61
3 changed files with 18 additions and 3 deletions

View file

@ -1 +1,2 @@
<a href="{{ .Destination | safeURL | relURL }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>
{{ $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") }}
<a class="gdoc-markdown__link{{ if $raw }}--raw{{ end }}" href="{{ .Destination | safeURL | relURL }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>