Permalink
Browse files

Add the "raw" template helper

  • Loading branch information...
1 parent f9931cb commit b3b68a218050fac6d150d4ad84fc66f2ea7346fb @robfig committed Feb 12, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 template.go
View
5 template.go
@@ -101,6 +101,11 @@ var (
return template.HTML(strings.Replace(template.HTMLEscapeString(text), "\n", "<br>", -1))
},
+ // Skips sanitation on the parameter. Do not use with dynamic data.
+ "raw": func(text string) template.HTML {
+ return template.HTML(text)
+ },
+
// Pluralize, a helper for pluralizing words to correspond to data of dynamic length.
// items - a slice of items, or an integer indicating how many items there are.
// pluralOverrides - optional arguments specifying the output in the

0 comments on commit b3b68a2

Please sign in to comment.