diff options
Diffstat (limited to '')
-rw-r--r-- | http_template_funcs.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/http_template_funcs.go b/http_template_funcs.go index 119a800..a7ebb1e 100644 --- a/http_template_funcs.go +++ b/http_template_funcs.go @@ -6,6 +6,7 @@ package main import ( "path" "strings" + "net/url" ) func first_line(s string) string { @@ -16,3 +17,11 @@ func first_line(s string) string { func base_name(s string) string { return path.Base(s) } + +func path_escape(s string) string { + return url.PathEscape(s) +} + +func query_escape(s string) string { + return url.QueryEscape(s) +} |