mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 22:50:35 +03:00
parent
729593c842
commit
3a786a248d
2 changed files with 42 additions and 1 deletions
|
@ -212,3 +212,27 @@ Some content
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/gohugoio/hugo/issues/4895
|
||||
func TestTemplateBOM(t *testing.T) {
|
||||
|
||||
b := newTestSitesBuilder(t).WithSimpleConfigFile()
|
||||
bom := "\ufeff"
|
||||
|
||||
b.WithTemplatesAdded(
|
||||
"_default/baseof.html", bom+`
|
||||
Base: {{ block "main" . }}base main{{ end }}`,
|
||||
"_default/single.html", bom+`{{ define "main" }}Hi!?{{ end }}`)
|
||||
|
||||
b.WithContent("page.md", `---
|
||||
title: "Page"
|
||||
---
|
||||
|
||||
Page Content
|
||||
`)
|
||||
|
||||
b.CreateSites().Build(BuildCfg{})
|
||||
|
||||
b.AssertFileContent("public/page/index.html", "Base: Hi!?")
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue