Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Allow alt and title tags in chat emojis (#1241)

Meisam10d126c31b5a
diff --git a/core/chat/events/events.go b/core/chat/events/events.go
index 1fb9980608..a66f444779 100644
--- a/core/chat/events/events.go
+++ b/core/chat/events/events.go
@@ -139,7 +139,8 @@ func sanitize(raw string) string {
p.AllowElements("br", "p")
// Allow img tags from the the local emoji directory only
- p.AllowAttrs("src", "alt", "class", "title").Matching(regexp.MustCompile(`(?i)/img/emoji`)).OnElements("img")
+ p.AllowAttrs("src").Matching(regexp.MustCompile(`(?i)/img/emoji`)).OnElements("img")
+ p.AllowAttrs("alt", "title").Matching(regexp.MustCompile(`:\S+:`)).OnElements("img")
p.AllowAttrs("class").OnElements("img")
// Allow bold