File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,6 @@ func ReplaceSanitizer() {
50
50
sanitizer .policy .AllowURLSchemes (setting .Markdown .CustomURLSchemes ... )
51
51
}
52
52
53
- // Allow keyword markup
54
- sanitizer .policy .AllowAttrs ("class" ).Matching (regexp .MustCompile (`^` + keywordClass + `$` )).OnElements ("span" )
55
-
56
53
// Allow classes for anchors
57
54
sanitizer .policy .AllowAttrs ("class" ).Matching (regexp .MustCompile (`ref-issue` )).OnElements ("a" )
58
55
@@ -68,8 +65,8 @@ func ReplaceSanitizer() {
68
65
// Allow classes for emojis
69
66
sanitizer .policy .AllowAttrs ("class" ).Matching (regexp .MustCompile (`emoji` )).OnElements ("img" )
70
67
71
- // Allow icons, emojis, and chroma syntax on span
72
- sanitizer .policy .AllowAttrs ("class" ).Matching (regexp .MustCompile (`^((icon(\s+[\p{L}\p{N}_-]+)+)|(emoji))$|^([a-z][a-z0-9]{0,2})$` )).OnElements ("span" )
68
+ // Allow icons, emojis, chroma syntax and keyword markup on span
69
+ sanitizer .policy .AllowAttrs ("class" ).Matching (regexp .MustCompile (`^((icon(\s+[\p{L}\p{N}_-]+)+)|(emoji))$|^([a-z][a-z0-9]{0,2})$|^` + keywordClass + `$ ` )).OnElements ("span" )
73
70
74
71
// Allow data tables
75
72
sanitizer .policy .AllowAttrs ("class" ).Matching (regexp .MustCompile (`data-table` )).OnElements ("table" )
You can’t perform that action at this time.
0 commit comments