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>

View file

@ -15,7 +15,7 @@
<div class="flex justify-center">
<figure class="gdoc-markdown__figure">
<a href="{{ .RelPermalink }}">
<a class="gdoc-markdown__link--raw" href="{{ .RelPermalink }}">
<img
{{ if $lazyLoad }}loading="lazy"{{ end }}
{{ with $customSize }}