diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-06-14 18:16:45 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-06-14 20:19:08 +0200 |
commit | d6ed17c60fd13c933347110c720afa09e04df1c8 (patch) | |
tree | 799961743618190d082dc705fd032fa43429d5b9 /hugolib/shortcode_test.go | |
parent | 145b3fcce35fbac25c7033c91c1b7ae6d1179da8 (diff) |
Fix crash for closing shortcode with no .Inner set
Fixes #6857
Closes #7330
Diffstat (limited to 'hugolib/shortcode_test.go')
-rw-r--r-- | hugolib/shortcode_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index d60bdd48b..8bb468465 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -1316,3 +1316,23 @@ title: "Hugo Rocks!" } } + +// https://github.com/gohugoio/hugo/issues/6857 +func TestShortcodeNoInner(t *testing.T) { + t.Parallel() + + b := newTestSitesBuilder(t) + + b.WithContent("page.md", `--- +title: "No Inner!" +--- +{{< noinner >}}{{< /noinner >}} + + +`).WithTemplatesAdded( + "layouts/shortcodes/noinner.html", `No inner here.`) + + err := b.BuildE(BuildCfg{}) + b.Assert(err.Error(), qt.Contains, `failed to extract shortcode: shortcode "noinner" has no .Inner, yet a closing tag was provided`) + +} |