mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Render Markdown in figure shortcode "caption" and "attr" params
Fixes https://github.com/gohugoio/hugo/issues/4406.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
c5279064df
commit
6818170308
@@ -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)
|
||||
|
Reference in New Issue
Block a user