mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 00:14:05 +00:00
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:
1 parent
dfae6dca85
commit
dbeb7fd871
1 file changed
+1
-1
@@ -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 -}}
|
||||
|
||||
Reference in new issue
Block a user