summaryrefslogtreecommitdiffstats
path: root/modules/base
diff options
context:
space:
mode:
authorHongcai Deng <admin@dhchouse.com>2015-09-09 17:31:14 +0800
committerHongcai Deng <admin@dhchouse.com>2015-09-09 17:31:14 +0800
commit357c002c033868f4211dc4daf9c701645664fd61 (patch)
tree2828f59c9c4b912a53c692da9b0568a09fabc817 /modules/base
parentf432f1f41c8a6dafee9b94abe9dccc972a839f87 (diff)
downloadgitea-357c002c033868f4211dc4daf9c701645664fd61.tar.gz
gitea-357c002c033868f4211dc4daf9c701645664fd61.zip
add allow attribute `class` to `<code>`
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()