Lines Matching full:template
5 package template
14 "text/template"
15 "text/template/parse"
229 `<button onclick='alert(1/ /* json: error calling MarshalJSON for type *template.badMarshaler: invalid character 'f' looking for beginning of object key string */null in numbers)'>`,
665 t.Errorf("%s: template execution failed: %s", test.name, err)
674 t.Errorf("%s: template execution failed for pointer: %s", test.name, err)
717 // A template called in the start context.
720 "main": `Hello, {{template "helper"}}!`,
721 // Not a valid top level HTML template.
727 // A template called in a context other than the start.
730 "main": `<a onclick='a = {{template "helper"}};'>`,
731 // Not a valid top level HTML template.
737 // A recursive template that ends in its start context.
740 "main": `{{range .Children}}{{template "main" .}}{{else}}{{.X}} {{end}}`,
744 // A recursive helper template that ends in its start context.
747 "main": `{{template "helper" .}}`,
748 "helper": `{{if .Children}}<ul>{{range .Children}}<li>{{template "main" .}}</li>{{end}}</ul>{{else}}{{.X}}{{end}}`,
755 "main": `<blockquote>{{range .Children}}{{template "helper" .}}{{end}}</blockquote>`,
756 "helper": `{{if .Children}}{{template "main" .}}{{else}}{{.X}}<br>{{end}}`,
760 // A template that is called in two different contexts.
763 "main": `<button onclick="title='{{template "helper"}}'; ...">{{template "helper"}}</button>`,
768 // A non-recursive template that ends in a different context.
772 "main": `<script>var x={{template "helper"}}/{{"42"}};</script>`,
777 // A recursive template that ends in a similar context.
780 "main": `<script>var x=[{{template "countdown" 4}}];</script>`,
781 "countdown": `{{.}}{{if .}},{{template "countdown" . | pred}}{{end}}`,
785 // A recursive template that ends in a different context.
789 "main": `<a href="/foo{{template "helper" .}}">`,
790 "helper": `{{if .Children}}{{range .Children}}{{template "helper" .}}{{end}}{{else}}?x={{.X}}{{end}}`,
797 // pred is a template function that returns the predecessor of a
934 `{{template "foo"}}`,
935 "z:1:11: no such template \"foo\"",
938 `<div{{template "y"}}>` +
944 `<script>reverseList = [{{template "t"}}]</script>` +
946 `{{define "t"}}{{if .Tail}}{{template "t" .Tail}}{{end}}{{.Head}}",{{end}}`,
947 `: cannot compute output context for template t$htmltemplate_stateJS_elementScript`,
951 `html/template:z: "=" in unquoted attr: "onclick="`,
955 `html/template:z: "=" in unquoted attr: "onclick="`,
959 `html/template:z: "=" in unquoted attr: "1+1=2"`,
963 "html/template:z: \"`\" in unquoted attr: \"`foo\"",
967 `html/template:z: "'" in unquoted attr: "font:'Arial'"`,
1574 tmpl := template.Must(template.New("test").Parse(test.input))
1733 // Unlike text/template, html/template crashed if given an incomplete
1734 // template, that is, a template that had been named but not given any content.
1744 t.Errorf("expected error about incomplete template; got %s", err)