diff options
Diffstat (limited to 'hugolib/page_test.go')
-rw-r--r-- | hugolib/page_test.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/hugolib/page_test.go b/hugolib/page_test.go index b8273ce28..9723b1426 100644 --- a/hugolib/page_test.go +++ b/hugolib/page_test.go @@ -1497,6 +1497,45 @@ func TestChompBOM(t *testing.T) { checkPageTitle(t, p, "Simple") } +func TestPageWithEmoji(t *testing.T) { + for _, enableEmoji := range []bool{true, false} { + v := viper.New() + v.Set("enableEmoji", enableEmoji) + b := newTestSitesBuilder(t) + b.WithViper(v) + + b.WithSimpleConfigFile() + + b.WithContent("page-emoji.md", `--- +title: "Hugo Smile" +--- +This is a :smile:. +<!--more--> + +Another :smile: This is :not: an emoji. + +`) + + b.CreateSites().Build(BuildCfg{}) + + if enableEmoji { + b.AssertFileContent("public/page-emoji/index.html", + "This is a 😄", + "Another 😄", + "This is :not: an emoji", + ) + } else { + b.AssertFileContent("public/page-emoji/index.html", + "This is a :smile:", + "Another :smile:", + "This is :not: an emoji", + ) + } + + } + +} + // https://github.com/gohugoio/hugo/issues/5381 func TestPageManualSummary(t *testing.T) { b := newTestSitesBuilder(t) |