Allow for ' in image alt tag

This commit is contained in:
2024-08-04 22:44:45 +02:00
parent 385319cd43
commit 03c9911428

View File

@ -10,7 +10,7 @@
{{- end }} {{- end }}
<img src="{{ .Get "src" | relURL }}" <img src="{{ .Get "src" | relURL }}"
{{- if or (.Get "alt") (.Get "caption") }} {{- if or (.Get "alt") (.Get "caption") }}
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" alt="{{ with .Get "alt" }}{{ replace . "'" "&#39;" }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
{{- end -}} {{- end -}}
/> <!-- Closing img tag --> /> <!-- Closing img tag -->
{{- if .Get "link" }}</a>{{ end -}} {{- if .Get "link" }}</a>{{ end -}}