mirror of
https://github.com/owncast/owncast.git
synced 2024-11-29 03:29:03 +03:00
Allow alt and title tags in chat emojis (#1241)
* allow alt and title on chat imgs * enforce non-empty alt&title tags for emojis
This commit is contained in:
parent
a366923797
commit
c4c1ecfc7b
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue