Jelajahi Sumber

fix: Hugo minfiy removes spaces in Figure captions

Add explicit   to prevent Hugo stripping desired spaces.

Fix #1972
George Cushen 4 tahun lalu
induk
melakukan
4dc8eff074
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      wowchemy/layouts/shortcodes/figure.html

+ 1 - 1
wowchemy/layouts/shortcodes/figure.html

@@ -47,7 +47,7 @@
 {{ if $caption }}
   {{/* Localize the figure numbering (if enabled). */}}
   {{ $figure := split (i18n "figure" | default "Figure %d:") "%d" }}
-  <figcaption{{ if eq (.Get "numbered") "true" }} data-pre="{{ index $figure 0 }}" data-post="{{ index $figure 1 }}" class="numbered"{{ end }}>
+  <figcaption{{ if eq (.Get "numbered") "true" }} data-pre="{{- trim (index $figure 0) " " -}}&nbsp;" data-post="{{ index $figure 1 }}&nbsp;" class="numbered"{{ end }}>
     {{ $caption | markdownify | emojify }}
   </figcaption>
 {{ end }}