// Write text to w; optionally html-escaped. func writeText(w io.Writer, text []byte, html bool) { if html { template.HTMLEscape(w, text) return } w.Write(text) }
// Template formatter for "html-esc" format. func htmlEscFmt(w io.Writer, format string, x ...interface{}) { var buf bytes.Buffer writeAny(&buf, false, x[0]) template.HTMLEscape(w, buf.Bytes()) }
func UrlHtmlFormatter(w io.Writer, fmt string, v ...interface{}) { template.HTMLEscape(w, []byte(url.QueryEscape(v[0].(string)))) }