# Functions
HTMLEscape writes to w the escaped HTML equivalent of the plain text data b.
HTMLEscaper returns the escaped HTML equivalent of the textual representation of its arguments.
HTMLEscapeString returns the escaped HTML equivalent of the plain text data s.
IsTrue reports whether the value is 'true', in the sense of not the zero of its type, and whether the value has a meaningful truth value.
JSEscape writes to w the escaped JavaScript equivalent of the plain text data b.
JSEscaper returns the escaped JavaScript equivalent of the textual representation of its arguments.
JSEscapeString returns the escaped JavaScript equivalent of the plain text data s.
Must is a helper that wraps a call to a function returning (*Template, error) and panics if the error is non-nil.
New allocates a new HTML template with the given name.
ParseFiles creates a new Template and parses the template definitions from the named files.
ParseGlob creates a new Template and parses the template definitions from the files identified by the pattern, which must match at least one file.
URLQueryEscaper returns the escaped value of the textual representation of its arguments in a form suitable for embedding in a URL query.
# Constants
ErrAmbigContext: "..
ErrBadHTML: "expected space, attr name, or end of tag, but got ...", "..
ErrBranchEnd: "{{if}} branches end in different contexts" Example: {{if .C}}<a href="{{end}}{{.X}} Discussion: Package html/template statically examines each path through an {{if}}, {{range}}, or {{with}} to escape any following pipelines.
ErrEndContext: "..
ErrNoSuchTemplate: "no such template ..." Examples: {{define "main"}}<div {{template "attrs"}}>{{end}} {{define "attrs"}}href="{{.URL}}"{{end}} Discussion: Package html/template looks through template calls to compute the context.
ErrOutputContext: "cannot compute output context for template ..." Examples: {{define "t"}}{{if .T}}{{template "t" .T}}{{end}}{{.H}}",{{end}} Discussion: A recursive template does not end in the same context in which it starts, and a reliable output context cannot be computed.
ErrPartialCharset: "unfinished JS regexp charset in ..." Example: <script>var pattern = /foo[{{.Chars}}]/</script> Discussion: Package html/template does not support interpolation into regular expression literal character sets.
ErrPartialEscape: "unfinished escape sequence in ..." Example: <script>alert("\{{.X}}")</script> Discussion: Package html/template does not support actions following a backslash.
ErrPredefinedEscaper: "predefined escaper ..
ErrRangeLoopReentry: "on range loop re-entry: ..." Example: <script>var x = [{{range .}}'{{.}},{{end}}]</script> Discussion: If an iteration through a range would cause it to end in a different context than an earlier pass, there is no single context.
ErrSlashAmbig: '/' could start a division or regexp.
OK indicates the lack of an error.
# Type aliases
Strings of content from a trusted source.
ErrorCode is a code for a kind of error.
FuncMap is the type of the map defining the mapping from names to functions.
Strings of content from a trusted source.
Strings of content from a trusted source.
Strings of content from a trusted source.
Strings of content from a trusted source.
Strings of content from a trusted source.
Strings of content from a trusted source.