diff options
Diffstat (limited to 'src/pkg/html/template/escape_test.go')
-rw-r--r-- | src/pkg/html/template/escape_test.go | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/pkg/html/template/escape_test.go b/src/pkg/html/template/escape_test.go index ce12c1795..de3659ba8 100644 --- a/src/pkg/html/template/escape_test.go +++ b/src/pkg/html/template/escape_test.go @@ -551,11 +551,6 @@ func TestEscape(t *testing.T) { "<textarea><a><b></textarea>", }, { - "auditable exemption from escaping", - "{{range .A}}{{. | noescape}}{{end}}", - "<a><b>", - }, - { "No tag injection", `{{"10$"}}<{{"script src,evil.org/pwnd.js"}}...`, `10$<script src,evil.org/pwnd.js...`, @@ -659,12 +654,6 @@ func TestEscape(t *testing.T) { for _, test := range tests { tmpl := New(test.name) - // TODO: Move noescape into template/func.go - tmpl.Funcs(FuncMap{ - "noescape": func(a ...interface{}) string { - return fmt.Sprint(a...) - }, - }) tmpl = Must(tmpl.Parse(test.input)) b := new(bytes.Buffer) if err := tmpl.Execute(b, data); err != nil { @@ -1539,6 +1528,11 @@ func TestEnsurePipelineContains(t *testing.T) { ".X | urlquery | html | print", []string{"urlquery", "html"}, }, + { + "{{($).X | html | print}}", + "($).X | urlquery | html | print", + []string{"urlquery", "html"}, + }, } for i, test := range tests { tmpl := template.Must(template.New("test").Parse(test.input)) |