From: bep Date: Thu, 30 Oct 2014 15:37:00 +0000 (+0100) Subject: Fix missing space before 'width' X-Git-Tag: v0.13~324 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=266511b6d392078695d0e22320f79fd4befe2f7a;p=brevno-suite%2Fhugo Fix missing space before 'width' The newly introduced width-param on figure did not work in combo with alt or caption due to space-issues. This fixes that. --- diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 5ec79325..6a5aadd7 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -72,13 +72,13 @@ func TestInnerSCWithMarkdown(t *testing.T) { func TestEmbeddedSC(t *testing.T) { tem := NewTemplate() CheckShortCodeMatch(t, "{{% test %}}", "This is a simple Test", tem) - CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" %}}`, "\n
\n \n \n \n \n
\n", tem) + CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" %}}`, "\n
\n \n \n \n \n
\n", tem) CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" caption="This is a caption" %}}`, "\n
\n \n \"This\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) + CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" width="100px" %}}`, "\n
\n \n \"apple\"\n \n \n
\n", tem) } func TestUnbalancedQuotes(t *testing.T) { diff --git a/hugolib/template_embedded.go b/hugolib/template_embedded.go index 5dec5e6b..14729cad 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" }}