@ -43,7 +43,7 @@ func ReplaceSanitizer() {
// Checkboxes
// Checkboxes
sanitizer . policy . AllowAttrs ( "type" ) . Matching ( regexp . MustCompile ( ` ^checkbox$ ` ) ) . OnElements ( "input" )
sanitizer . policy . AllowAttrs ( "type" ) . Matching ( regexp . MustCompile ( ` ^checkbox$ ` ) ) . OnElements ( "input" )
sanitizer . policy . AllowAttrs ( "checked" , "disabled" , "readonly" ) . OnElements ( "input" )
sanitizer . policy . AllowAttrs ( "checked" , "disabled" ) . OnElements ( "input" )
// Custom URL-Schemes
// Custom URL-Schemes
sanitizer . policy . AllowURLSchemes ( setting . Markdown . CustomURLSchemes ... )
sanitizer . policy . AllowURLSchemes ( setting . Markdown . CustomURLSchemes ... )
@ -66,8 +66,8 @@ func ReplaceSanitizer() {
// Allow classes for emojis
// Allow classes for emojis
sanitizer . policy . AllowAttrs ( "class" ) . Matching ( regexp . MustCompile ( ` emoji ` ) ) . OnElements ( "img" )
sanitizer . policy . AllowAttrs ( "class" ) . Matching ( regexp . MustCompile ( ` emoji ` ) ) . OnElements ( "img" )
// Allow icons, checkboxes, emojis, and chroma syntax on span
// Allow icons, emojis, and chroma syntax on span
sanitizer . policy . AllowAttrs ( "class" ) . Matching ( regexp . MustCompile ( ` ^((icon(\s+[\p { L}\p { N}_-]+)+)|(ui checkbox)|(ui checked checkbox)|( emoji))$|^([a-z][a-z0-9] { 0,2})$ ` ) ) . OnElements ( "span" )
sanitizer . policy . AllowAttrs ( "class" ) . Matching ( regexp . MustCompile ( ` ^((icon(\s+[\p { L}\p { N}_-]+)+)|(emoji))$|^([a-z][a-z0-9] { 0,2})$ ` ) ) . OnElements ( "span" )
// Allow generally safe attributes
// Allow generally safe attributes
generalSafeAttrs := [ ] string { "abbr" , "accept" , "accept-charset" ,
generalSafeAttrs := [ ] string { "abbr" , "accept" , "accept-charset" ,