Skip to content

Commit 02f7752

Browse files
committed
review suggestion
1 parent d5fa399 commit 02f7752

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/markup/sanitizer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func ReplaceSanitizer() {
6666
sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`emoji`)).OnElements("img")
6767

6868
// Allow icons, checkboxes, emojis, and chroma syntax on span
69-
sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`^((icon(\s+[\p{L}\p{N}_-]+)+)|(ui checkbox)|(ui checked checkbox)|(emoji))$|^((c|g|i|k|m|n|o|s|u|v|w)[a-z0-9]{0,2})$`)).OnElements("span")
69+
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")
7070

7171
// Allow generally safe attributes
7272
generalSafeAttrs := []string{"abbr", "accept", "accept-charset",

0 commit comments

Comments
 (0)