aboutsummaryrefslogtreecommitdiff
path: root/modules/template/template.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/template/template.go')
-rw-r--r--modules/template/template.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/template/template.go b/modules/template/template.go
index d5d9804d..f7ce7dca 100644
--- a/modules/template/template.go
+++ b/modules/template/template.go
@@ -15,6 +15,7 @@ import (
"strings"
"time"
+ "github.com/microcosm-cc/bluemonday"
"golang.org/x/net/html/charset"
"golang.org/x/text/transform"
log "gopkg.in/clog.v1"
@@ -60,6 +61,7 @@ func NewFuncMap() []template.FuncMap {
},
"AvatarLink": base.AvatarLink,
"Safe": Safe,
+ "Sanitize": bluemonday.UGCPolicy().Sanitize,
"Str2html": Str2html,
"TimeSince": base.TimeSince,
"RawTimeSince": base.RawTimeSince,