From 9b34d42bb2ff05deaeeef63ff4b5b993f35f0451 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Fri, 9 Apr 2021 19:03:01 -0700 Subject: Remove extraneous space from figure shortcode Fixes #8401 --- hugolib/shortcode_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'hugolib/shortcode_test.go') diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 7f206a788..bce95b527 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -242,8 +242,8 @@ func TestInnerSCWithMarkdown(t *testing.T) { func TestEmbeddedSC(t *testing.T) { t.Parallel() - CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" %}}`, "
\n \n
", nil) - CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" caption="This is a caption" %}}`, "
\n \"This
\n

This is a caption

\n
\n
", nil) + CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" %}}`, "
\n
", nil) + CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" caption="This is a caption" %}}`, "
\"This
\n

This is a caption

\n
\n
", nil) } func TestNestedSC(t *testing.T) { @@ -288,43 +288,43 @@ func TestParentShortcode(t *testing.T) { func TestFigureOnlySrc(t *testing.T) { t.Parallel() - CheckShortCodeMatch(t, `{{< figure src="/found/here" >}}`, "
\n \n
", nil) + CheckShortCodeMatch(t, `{{< figure src="/found/here" >}}`, "
\n
", nil) } func TestFigureCaptionAttrWithMarkdown(t *testing.T) { t.Parallel() - CheckShortCodeMatch(t, `{{< figure src="/found/here" caption="Something **bold** _italic_" >}}`, "
\n \"Something
\n

Something bold italic

\n
\n
", nil) - CheckShortCodeMatch(t, `{{< figure src="/found/here" attr="Something **bold** _italic_" >}}`, "
\n
\n

Something bold italic

\n
\n
", nil) + CheckShortCodeMatch(t, `{{< figure src="/found/here" caption="Something **bold** _italic_" >}}`, "
\"Something
\n

Something bold italic

\n
\n
", nil) + CheckShortCodeMatch(t, `{{< figure src="/found/here" attr="Something **bold** _italic_" >}}`, "
\n

Something bold italic

\n
\n
", nil) } func TestFigureImgWidth(t *testing.T) { t.Parallel() - CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" width="100px" %}}`, "
\n \"apple\" \n
", nil) + CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" width="100px" %}}`, "
\"apple\"\n
", nil) } func TestFigureImgHeight(t *testing.T) { t.Parallel() - CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" height="100px" %}}`, "
\n \"apple\" \n
", nil) + CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" height="100px" %}}`, "
\"apple\"\n
", nil) } func TestFigureImgWidthAndHeight(t *testing.T) { t.Parallel() - CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" width="50" height="100" %}}`, "
\n \"apple\" \n
", nil) + CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" width="50" height="100" %}}`, "
\"apple\"\n
", nil) } func TestFigureLinkNoTarget(t *testing.T) { t.Parallel() - CheckShortCodeMatch(t, `{{< figure src="/found/here" link="/jump/here/on/clicking" >}}`, "
\n \n
", nil) + CheckShortCodeMatch(t, `{{< figure src="/found/here" link="/jump/here/on/clicking" >}}`, "
\n
", nil) } func TestFigureLinkWithTarget(t *testing.T) { t.Parallel() - CheckShortCodeMatch(t, `{{< figure src="/found/here" link="/jump/here/on/clicking" target="_self" >}}`, "
\n \n
", nil) + CheckShortCodeMatch(t, `{{< figure src="/found/here" link="/jump/here/on/clicking" target="_self" >}}`, "
\n
", nil) } func TestFigureLinkWithTargetAndRel(t *testing.T) { t.Parallel() - CheckShortCodeMatch(t, `{{< figure src="/found/here" link="/jump/here/on/clicking" target="_blank" rel="noopener" >}}`, "
\n \n
", nil) + CheckShortCodeMatch(t, `{{< figure src="/found/here" link="/jump/here/on/clicking" target="_blank" rel="noopener" >}}`, "
\n
", nil) } // #1642 -- cgit v1.2.3