diff options
author | Kaushal Modi <kaushal.modi@gmail.com> | 2018-10-02 15:23:10 -0400 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-10-03 09:55:53 +0300 |
commit | 6818170308994b5f01dec7a559f92d6c7c5ca100 (patch) | |
tree | ae9cd2b0f55f336de421468c39adfa8f2e18f03f /tpl | |
parent | c5279064df9664d6b2ad277e2fba1e4bb3b0f4be (diff) |
Render Markdown in figure shortcode "caption" and "attr" params
Fixes https://github.com/gohugoio/hugo/issues/4406.
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/tplimpl/embedded/templates.autogen.go | 6 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/shortcodes/figure.html | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tpl/tplimpl/embedded/templates.autogen.go b/tpl/tplimpl/embedded/templates.autogen.go index 23f3cfe84..2b36ae37b 100644 --- a/tpl/tplimpl/embedded/templates.autogen.go +++ b/tpl/tplimpl/embedded/templates.autogen.go @@ -315,7 +315,7 @@ if (!doNotTrack) { {{- end }} <img src="{{ .Get "src" }}" {{- if or (.Get "alt") (.Get "caption") }} - alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" }}{{ end }}" + alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" {{- end -}} {{- with .Get "width" }} width="{{ . }}"{{ end -}} {{- with .Get "height" }} height="{{ . }}"{{ end -}} @@ -327,11 +327,11 @@ if (!doNotTrack) { <h4>{{ . }}</h4> {{- end -}} {{- if or (.Get "caption") (.Get "attr") -}}<p> - {{- .Get "caption" -}} + {{- .Get "caption" | markdownify -}} {{- with .Get "attrlink" -}} <a href="{{ . }}"> {{- end -}} - {{- .Get "attr" -}} + {{- .Get "attr" | markdownify -}} {{- if .Get "attrlink" }}</a>{{ end }}</p> {{- end }} </figcaption> diff --git a/tpl/tplimpl/embedded/templates/shortcodes/figure.html b/tpl/tplimpl/embedded/templates/shortcodes/figure.html index 9fa847eaa..2da48ca8f 100644 --- a/tpl/tplimpl/embedded/templates/shortcodes/figure.html +++ b/tpl/tplimpl/embedded/templates/shortcodes/figure.html @@ -4,7 +4,7 @@ {{- end }} <img src="{{ .Get "src" }}" {{- if or (.Get "alt") (.Get "caption") }} - alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" }}{{ end }}" + alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" {{- end -}} {{- with .Get "width" }} width="{{ . }}"{{ end -}} {{- with .Get "height" }} height="{{ . }}"{{ end -}} @@ -16,11 +16,11 @@ <h4>{{ . }}</h4> {{- end -}} {{- if or (.Get "caption") (.Get "attr") -}}<p> - {{- .Get "caption" -}} + {{- .Get "caption" | markdownify -}} {{- with .Get "attrlink" -}} <a href="{{ . }}"> {{- end -}} - {{- .Get "attr" -}} + {{- .Get "attr" | markdownify -}} {{- if .Get "attrlink" }}</a>{{ end }}</p> {{- end }} </figcaption> |