diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-14 09:57:37 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-14 10:00:06 +0100 |
commit | 812688fc2f3e220ac35cad9f0445a2548f0cc603 (patch) | |
tree | e2c6f10f27e44e3c7a7f2c5c8bfba8cde6f5ee3d /hugolib/shortcode_test.go | |
parent | a2670bf460e10ed5de69f90abbe7c4e2b32068cf (diff) |
hugolib: Fix emoji handling inside shortcodes
Fixes #6504
Diffstat (limited to 'hugolib/shortcode_test.go')
-rw-r--r-- | hugolib/shortcode_test.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 01fa61512..eb763b2a0 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -1171,6 +1171,33 @@ title: "Hugo Rocks!" ) } +// https://github.com/gohugoio/hugo/issues/6504 +func TestShortcodeEmoji(t *testing.T) { + t.Parallel() + + v := viper.New() + v.Set("enableEmoji", true) + + builder := newTestSitesBuilder(t).WithViper(v) + + builder.WithContent("page.md", `--- +title: "Hugo Rocks!" +--- + +# doc + +{{< event >}}10:30-11:00 My :smile: Event {{< /event >}} + + +`).WithTemplatesAdded( + "layouts/shortcodes/event.html", `<div>{{ "\u29BE" }} {{ .Inner }} </div>`) + + builder.Build(BuildCfg{}) + builder.AssertFileContent("public/page/index.html", + "⦾ 10:30-11:00 My 😄 Event", + ) +} + func TestShortcodeTypedParams(t *testing.T) { t.Parallel() c := qt.New(t) |