From: David Symonds Date: Sat, 13 Aug 2011 04:00:16 +0000 (+1000) Subject: exp/template: rename filter: url -> urlquery. X-Git-Tag: weekly.2011-08-17~58 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5e48e648f1729d02c0a9c411759f8eff9b5d9cb3;p=gostls13.git exp/template: rename filter: url -> urlquery. R=r, rsc CC=golang-dev https://golang.org/cl/4873046 --- diff --git a/lib/godoc/codewalk.html b/lib/godoc/codewalk.html index 59a9efcf2d..2835c6e82c 100644 --- a/lib/godoc/codewalk.html +++ b/lib/godoc/codewalk.html @@ -19,7 +19,7 @@ @@ -37,7 +37,7 @@
{{range .Step}}
- +
{{html .Title}}
{{with .Err}} diff --git a/lib/godoc/codewalkdir.html b/lib/godoc/codewalkdir.html index b174020e8e..6fe1a0565a 100644 --- a/lib/godoc/codewalkdir.html +++ b/lib/godoc/codewalkdir.html @@ -7,7 +7,7 @@ {{range .}} - + diff --git a/lib/godoc/dirlist.html b/lib/godoc/dirlist.html index 5a3ddfaf39..422397e522 100644 --- a/lib/godoc/dirlist.html +++ b/lib/godoc/dirlist.html @@ -18,7 +18,7 @@ {{range .}} - + diff --git a/lib/godoc/godoc.html b/lib/godoc/godoc.html index e978b309c6..91e521258d 100644 --- a/lib/godoc/godoc.html +++ b/lib/godoc/godoc.html @@ -25,7 +25,7 @@ {{with .PkgRoots}} {{range .PkgRoots}} - {{html .}}| + {{html .}}| {{end}} {{else}} References: diff --git a/lib/godoc/package.html b/lib/godoc/package.html index 265e5d53b5..0bc017379c 100644 --- a/lib/godoc/package.html +++ b/lib/godoc/package.html @@ -87,7 +87,7 @@

{{/* PList entries are strings - no need for FSet */}} {{range .}} - {{html .}}
+ {{html .}}
{{end}}

{{end}} diff --git a/lib/godoc/search.html b/lib/godoc/search.html index 39eec9b498..946160cf53 100644 --- a/lib/godoc/search.html +++ b/lib/godoc/search.html @@ -12,7 +12,7 @@

Did you mean: {{range .Alts}} - {{html .}} + {{html .}} {{end}}

{{end}} @@ -21,12 +21,12 @@

Package-level declarations

{{range .}} {{$pkg := pkgLink .Pak.Path}} -

package {{html .Pak.Name}}

+

package {{html .Pak.Name}}

{{range .Files}} {{$src := srcLink .File.Path}} {{range .Groups}} {{range .Infos}} - {{html $src}}:{{infoLine .}} + {{html $src}}:{{infoLine .}} {{infoSnippet_html .}} {{end}} {{end}} @@ -37,10 +37,10 @@

Local declarations and uses

{{range .}} {{$pkg := pkgLink .Pak.Path}} -

package {{html .Pak.Name}}

+

package {{html .Pak.Name}}

{{range .Files}} {{$src := srcLink .File.Path}} - {{html $src}} + {{html $src}}
{{html .Name}}{{html .Name}}   {{html .Title}}
{{.|fileInfoName|html}}{{.|fileInfoName|html}} {{html .Size}}
{{range .Groups}} @@ -49,7 +49,7 @@ @@ -74,14 +74,14 @@ {{$src := srcLink .Filename}}
{{range .Infos}} - {{infoLine .}} + {{infoLine .}} {{end}}
- {{html $src}}: + {{html $src}}: {{len .Lines}} {{range .Lines}} - {{html .}} + {{html .}} {{end}} {{if not $.Complete}} ... diff --git a/src/pkg/exp/template/doc.go b/src/pkg/exp/template/doc.go index ed0172ac8e..46a38040e3 100644 --- a/src/pkg/exp/template/doc.go +++ b/src/pkg/exp/template/doc.go @@ -247,9 +247,9 @@ Predefined global functions are named as follows. An alias for fmt.Sprintf println An alias for fmt.Sprintln - url + urlquery Returns the escaped value of the textual representation of - its arguments in a form suitable for embedding in a URL. + its arguments in a form suitable for embedding in a URL query. The boolean functions take any zero value to be false and a non-zero value to be true. diff --git a/src/pkg/exp/template/exec_test.go b/src/pkg/exp/template/exec_test.go index 58e9526303..a8ef64d2e0 100644 --- a/src/pkg/exp/template/exec_test.go +++ b/src/pkg/exp/template/exec_test.go @@ -313,8 +313,8 @@ var execTests = []execTest{ // JavaScript. {"js", `{{js .}}`, `It\'d be nice.`, `It'd be nice.`, true}, - // URL. - {"url", `{{"http://www.example.org/"|url}}`, "http%3A%2F%2Fwww.example.org%2F", nil, true}, + // URL query. + {"urlquery", `{{"http://www.example.org/"|urlquery}}`, "http%3A%2F%2Fwww.example.org%2F", nil, true}, // Booleans {"not", "{{not true}} {{not false}}", "false true", nil, true}, diff --git a/src/pkg/exp/template/funcs.go b/src/pkg/exp/template/funcs.go index b2878a161b..6de46aa451 100644 --- a/src/pkg/exp/template/funcs.go +++ b/src/pkg/exp/template/funcs.go @@ -23,17 +23,17 @@ import ( type FuncMap map[string]interface{} var builtins = FuncMap{ - "and": and, - "html": HTMLEscaper, - "index": index, - "js": JSEscaper, - "len": length, - "not": not, - "or": or, - "print": fmt.Sprint, - "printf": fmt.Sprintf, - "println": fmt.Sprintln, - "url": URLEscaper, + "and": and, + "html": HTMLEscaper, + "index": index, + "js": JSEscaper, + "len": length, + "not": not, + "or": or, + "print": fmt.Sprint, + "printf": fmt.Sprintf, + "println": fmt.Sprintln, + "urlquery": URLQueryEscaper, } var builtinFuncs = createValueFuncs(builtins) @@ -354,9 +354,9 @@ func JSEscaper(args ...interface{}) string { return JSEscapeString(s) } -// URLEscaper returns the escaped value of the textual representation of its -// arguments in a form suitable for embedding in a URL. -func URLEscaper(args ...interface{}) string { +// URLQueryEscaper returns the escaped value of the textual representation of +// its arguments in a form suitable for embedding in a URL query. +func URLQueryEscaper(args ...interface{}) string { s, ok := "", false if len(args) == 1 { s, ok = args[0].(string)