feat: enable rich text in figure lightbox captions

By adding `safeHTMLAttr`, similarly to the gallery shortcode.

Enables links to show within the figure lightbox, for example.

Close #1706
This commit is contained in:
George Cushen committed 2020-05-28 21:52:04 +01:00
1 parent dfae6dca85
commit dbeb7fd871
1 file changed
+1 -1
+1 -1
View File
@@ -21,7 +21,7 @@
<figure{{ with .Get "class" }} class="{{.}}"{{ end }} {{ with $caption }}id="figure-{{ anchorize . }}"{{ end }}>
{{ if $lightbox }}
<a data-fancybox="{{$group}}" href="{{$image_src}}" {{ with $caption }}data-caption="{{ .|markdownify|emojify }}"{{ end }}>
<a data-fancybox="{{$group}}" href="{{$image_src}}" {{ with $caption }}data-caption="{{ .|markdownify|emojify|safeHTMLAttr }}"{{ end }}>
{{ else if .Get "link"}}
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{.}}"{{ end }}{{ with .Get "rel" }} rel="{{.}}"{{ end }}>
{{ end -}}