mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
committed by
Bjørn Erik Pedersen
parent
31d19b505d
commit
5bbe95f9c5
@@ -248,7 +248,7 @@ func TestToMathMacros(t *testing.T) {
|
||||
-- hugo.toml --
|
||||
disableKinds = ['page','rss','section','sitemap','taxonomy','term']
|
||||
-- layouts/index.html --
|
||||
{{ $macros := dict
|
||||
{{ $macros := dict
|
||||
"\\addBar" "\\bar{#1}"
|
||||
"\\bold" "\\mathbf{#1}"
|
||||
}}
|
||||
@@ -261,3 +261,21 @@ disableKinds = ['page','rss','section','sitemap','taxonomy','term']
|
||||
<mi>y</mi>
|
||||
`)
|
||||
}
|
||||
|
||||
// Issue #12977
|
||||
func TestUnmarshalWithIndentedYAML(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
disableKinds = ['page','rss','section','sitemap','taxonomy','term']
|
||||
-- layouts/index.html --
|
||||
{{ $yaml := "\n a:\n b: 1\n c:\n d: 2\n" }}
|
||||
{{ $yaml | transform.Unmarshal | encoding.Jsonify }}
|
||||
`
|
||||
|
||||
b := hugolib.Test(t, files)
|
||||
|
||||
b.AssertFileExists("public/index.html", true)
|
||||
b.AssertFileContent("public/index.html", `{"a":{"b":1},"c":{"d":2}}`)
|
||||
}
|
||||
|
Reference in New Issue
Block a user