mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Add a test case for Go 1.16 template action newlines
This commit is contained in:
parent
cf3e077da3
commit
ae57ba6a9d
1 changed files with 17 additions and 0 deletions
|
@ -584,6 +584,22 @@ func TestTemplateGoIssues(t *testing.T) {
|
||||||
"index.html", `
|
"index.html", `
|
||||||
{{ $title := "a & b" }}
|
{{ $title := "a & b" }}
|
||||||
<script type="application/ld+json">{"@type":"WebPage","headline":"{{$title}}"}</script>
|
<script type="application/ld+json">{"@type":"WebPage","headline":"{{$title}}"}</script>
|
||||||
|
|
||||||
|
{{/* Action newlines, from Go 1.16, see https://github.com/golang/go/issues/29770 */}}
|
||||||
|
{{ $norway := dict
|
||||||
|
"country" "Norway"
|
||||||
|
"population" "5 millions"
|
||||||
|
"language" "Norwegian"
|
||||||
|
"language_code" "nb"
|
||||||
|
"weather" "freezing cold"
|
||||||
|
"capitol" "Oslo"
|
||||||
|
"largest_city" "Oslo"
|
||||||
|
"currency" "Norwegian krone"
|
||||||
|
"dialing_code" "+47"
|
||||||
|
}}
|
||||||
|
|
||||||
|
Population in Norway is {{ $norway.population }}
|
||||||
|
|
||||||
`,
|
`,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -591,6 +607,7 @@ func TestTemplateGoIssues(t *testing.T) {
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", `
|
b.AssertFileContent("public/index.html", `
|
||||||
<script type="application/ld+json">{"@type":"WebPage","headline":"a \u0026 b"}</script>
|
<script type="application/ld+json">{"@type":"WebPage","headline":"a \u0026 b"}</script>
|
||||||
|
Population in Norway is 5 millions
|
||||||
|
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue