diff options
Diffstat (limited to 'modules/markup/sanitizer.go')
-rw-r--r-- | modules/markup/sanitizer.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/markup/sanitizer.go b/modules/markup/sanitizer.go index ddb5584e80..faf4163109 100644 --- a/modules/markup/sanitizer.go +++ b/modules/markup/sanitizer.go @@ -63,6 +63,10 @@ func ReplaceSanitizer() { // Allow unlabelled labels sanitizer.policy.AllowNoAttrs().OnElements("label") + // Allow classes for emojis + sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`emoji`)).OnElements("span") + sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`emoji`)).OnElements("img") + // Allow generally safe attributes generalSafeAttrs := []string{"abbr", "accept", "accept-charset", "accesskey", "action", "align", "alt", |