mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
@@ -242,7 +242,7 @@ func TestEscape(t *testing.T) {
|
||||
{
|
||||
"jsStr",
|
||||
"<button onclick='alert("{{.H}}")'>",
|
||||
`<button onclick='alert("\x3cHello\x3e")'>`,
|
||||
`<button onclick='alert("\u003cHello\u003e")'>`,
|
||||
},
|
||||
{
|
||||
"badMarshaler",
|
||||
@@ -263,7 +263,7 @@ func TestEscape(t *testing.T) {
|
||||
{
|
||||
"jsRe",
|
||||
`<button onclick='alert(/{{"foo+bar"}}/.test(""))'>`,
|
||||
`<button onclick='alert(/foo\x2bbar/.test(""))'>`,
|
||||
`<button onclick='alert(/foo\u002bbar/.test(""))'>`,
|
||||
},
|
||||
{
|
||||
"jsReBlank",
|
||||
@@ -829,7 +829,7 @@ func TestEscapeSet(t *testing.T) {
|
||||
"main": `<button onclick="title='{{template "helper"}}'; ...">{{template "helper"}}</button>`,
|
||||
"helper": `{{11}} of {{"<100>"}}`,
|
||||
},
|
||||
`<button onclick="title='11 of \x3c100\x3e'; ...">11 of <100></button>`,
|
||||
`<button onclick="title='11 of \u003c100\u003e'; ...">11 of <100></button>`,
|
||||
},
|
||||
// A non-recursive template that ends in a different context.
|
||||
// helper starts in jsCtxRegexp and ends in jsCtxDivOp.
|
||||
|
Reference in New Issue
Block a user