summaryrefslogtreecommitdiffstats
path: root/modules/base
diff options
context:
space:
mode:
Diffstat (limited to 'modules/base')
-rw-r--r--modules/base/tool.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go
index 0e118552aa..0fa5648191 100644
--- a/modules/base/tool.go
+++ b/modules/base/tool.go
@@ -28,6 +28,10 @@ import (
var Sanitizer = bluemonday.UGCPolicy()
+func init() {
+ Sanitizer.AllowAttrs("class").OnElements("code")
+}
+
// Encode string to md5 hex value.
func EncodeMd5(str string) string {
m := md5.New()