From 266511b6d392078695d0e22320f79fd4befe2f7a Mon Sep 17 00:00:00 2001 From: bep Date: Thu, 30 Oct 2014 16:37:00 +0100 Subject: [PATCH] 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. --- hugolib/shortcode_test.go | 4 ++-- hugolib/template_embedded.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 5ec793250..6a5aadd79 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 5dec5e6bf..14729cadf 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" }}