Browse Source

add allow attribute `class` to `<code>`

tags/v1.21.12.1
Hongcai Deng 10 years ago
parent
commit
357c002c03
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      modules/base/tool.go

+ 4
- 0
modules/base/tool.go View File

@@ -28,6 +28,10 @@ import (


var Sanitizer = bluemonday.UGCPolicy() var Sanitizer = bluemonday.UGCPolicy()


func init() {
Sanitizer.AllowAttrs("class").OnElements("code")
}

// Encode string to md5 hex value. // Encode string to md5 hex value.
func EncodeMd5(str string) string { func EncodeMd5(str string) string {
m := md5.New() m := md5.New()


Loading…
Cancel
Save