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 /hugolib | |
parent | c5279064df9664d6b2ad277e2fba1e4bb3b0f4be (diff) |
Render Markdown in figure shortcode "caption" and "attr" params
Fixes https://github.com/gohugoio/hugo/issues/4406.
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/shortcode_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 084662b7a..df7b7103f 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -305,6 +305,12 @@ func TestFigureOnlySrc(t *testing.T) { CheckShortCodeMatch(t, `{{< figure src="/found/here" >}}`, "<figure>\n <img src=\"/found/here\"/> \n</figure>", nil) } +func TestFigureCaptionAttrWithMarkdown(t *testing.T) { + t.Parallel() + CheckShortCodeMatch(t, `{{< figure src="/found/here" caption="Something **bold** _italic_" >}}`, "<figure>\n <img src=\"/found/here\"\n alt=\"Something bold italic\"/> <figcaption>\n <p>Something <strong>bold</strong> <em>italic</em></p>\n </figcaption>\n</figure>", nil) + CheckShortCodeMatch(t, `{{< figure src="/found/here" attr="Something **bold** _italic_" >}}`, "<figure>\n <img src=\"/found/here\"/> <figcaption>\n <p>Something <strong>bold</strong> <em>italic</em></p>\n </figcaption>\n</figure>", nil) +} + func TestFigureImgWidth(t *testing.T) { t.Parallel() CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" width="100px" %}}`, "<figure class=\"bananas orange\">\n <img src=\"/found/here\"\n alt=\"apple\" width=\"100px\"/> \n</figure>", nil) |