projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6274aa0
)
Added safeHtml template function
author
Nelson Silva
<nelson.silva@inevo.pt>
Mon, 9 Sep 2013 11:43:30 +0000
(12:43 +0100)
committer
spf13
<steve.francia@gmail.com>
Tue, 10 Sep 2013 21:19:45 +0000
(17:19 -0400)
template/bundle/template.go
patch
|
blob
|
history
diff --git
a/template/bundle/template.go
b/template/bundle/template.go
index 052b2f73e870c30ab8e72df25bcbcad939f704d9..7a194a71d29fa09016d3227f1cbbb3864187f497 100644
(file)
--- a/
template/bundle/template.go
+++ b/
template/bundle/template.go
@@
-78,6
+78,10
@@
func ReturnWhenSet(a interface{}, index int) interface{} {
return ""
}
+func SafeHtml(text string) template.HTML {
+ return template.HTML(text)
+}
+
type Template interface {
ExecuteTemplate(wr io.Writer, name string, data interface{}) error
Lookup(name string) *template.Template
@@
-108,6
+112,7
@@
func NewTemplate() Template {
"gt": Gt,
"isset": IsSet,
"echoParam": ReturnWhenSet,
+ "safeHtml": SafeHtml,
}
templates.Funcs(funcMap)