aboutsummaryrefslogtreecommitdiffhomepage
path: root/template/functions.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2020-01-02 11:06:57 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2020-01-02 11:20:10 -0800
commit4d9956cf658d7a970654ae3baf23ad995e287525 (patch)
tree475fc8d39549ec24ad09e0fbc0b206ef0141994c /template/functions.go
parentac3c936820033f27e32c9a4490f2f33d6ffd6b05 (diff)
Make sure external URLs are not encoded incorrectly by Go template engine
Diffstat (limited to 'template/functions.go')
-rw-r--r--template/functions.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/template/functions.go b/template/functions.go
index 157935d..3b6423f 100644
--- a/template/functions.go
+++ b/template/functions.go
@@ -48,6 +48,9 @@ func (f *funcMap) Map() template.FuncMap {
"route": func(name string, args ...interface{}) string {
return route.Path(f.router, name, args...)
},
+ "safeURL": func(url string) template.URL {
+ return template.URL(url)
+ },
"noescape": func(str string) template.HTML {
return template.HTML(str)
},