mirror of
https://github.com/golang/go
synced 2024-11-13 18:00:30 -07:00
fix final program to have Html->HTML
R=rsc CC=go-dev https://golang.org/cl/152050
This commit is contained in:
parent
6672eb3797
commit
8db6370d78
@ -2394,7 +2394,7 @@ import (
|
|||||||
|
|
||||||
var addr = flag.String("addr", ":1718", "http service address") // Q=17, R=18
|
var addr = flag.String("addr", ":1718", "http service address") // Q=17, R=18
|
||||||
var fmap = template.FormatterMap{
|
var fmap = template.FormatterMap{
|
||||||
"html": template.HtmlFormatter,
|
"html": template.HTMLFormatter,
|
||||||
"url+html": UrlHtmlFormatter,
|
"url+html": UrlHtmlFormatter,
|
||||||
}
|
}
|
||||||
var templ = template.MustParse(templateStr, fmap)
|
var templ = template.MustParse(templateStr, fmap)
|
||||||
@ -2413,7 +2413,7 @@ func QR(c *http.Conn, req *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func UrlHtmlFormatter(w io.Writer, v interface{}, fmt string) {
|
func UrlHtmlFormatter(w io.Writer, v interface{}, fmt string) {
|
||||||
template.HtmlEscape(w, strings.Bytes(http.URLEscape(v.(string))));
|
template.HTMLEscape(w, strings.Bytes(http.URLEscape(v.(string))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user