test emoji title and alt tag sanitization (#1244)
This commit is contained in:
@@ -44,8 +44,8 @@ func TestBlockRemoteImages(t *testing.T) {
|
||||
|
||||
// Test to make sure emoji images are allowed in chat messages.
|
||||
func TestAllowEmojiImages(t *testing.T) {
|
||||
messageContent := `<img src="/img/emoji/beerparrot.gif"> test `
|
||||
expected := `<p><img src="/img/emoji/beerparrot.gif"> test <img src="/img/emoji/beerparrot.gif"></p>`
|
||||
messageContent := `<img alt=":beerparrot:" title=":beerparrot:" src="/img/emoji/beerparrot.gif"> test `
|
||||
expected := `<p><img alt=":beerparrot:" title=":beerparrot:" src="/img/emoji/beerparrot.gif"> test <img src="/img/emoji/beerparrot.gif"></p>`
|
||||
result := events.RenderAndSanitize(messageContent)
|
||||
|
||||
if result != expected {
|
||||
|
||||
Reference in New Issue
Block a user