diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 115c70fdd..5ec793250 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -76,6 +76,11 @@ func TestEmbeddedSC(t *testing.T) { CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" caption="This is a caption" %}}`, "\n\n \n \n \n \n \n \n This is a caption\n \n \n \n \n \n \n\n", tem) } +func TestFigureImgWidth(t *testing.T) { + tem := NewTemplate() + CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" width="100px" %}}`, "\n\n \n \n \n \n\n", tem) +} + func TestUnbalancedQuotes(t *testing.T) { tem := NewTemplate() diff --git a/hugolib/template_embedded.go b/hugolib/template_embedded.go index 6a1dbd91f..5dec5e6bf 100644 --- a/hugolib/template_embedded.go +++ b/hugolib/template_embedded.go @@ -24,7 +24,7 @@ func (t *GoHtmlTemplate) EmbedShortcodes() { t.AddInternalShortcode("figure.html", ` {{ with .Get "link"}}{{ end }} - + {{ if .Get "link"}}{{ end }} {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} {{ if isset .Params "title" }}
\n This is a caption\n \n \n \n