Browse Source

test emoji title and alt tag sanitization (#1244)

pull/1253/head
Meisam 4 years ago committed by GitHub
parent
commit
e1c4b452e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      core/chat/messageRendering_test.go

4
core/chat/messageRendering_test.go

@ -44,8 +44,8 @@ func TestBlockRemoteImages(t *testing.T) { @@ -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 ![](/img/emoji/beerparrot.gif)`
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 ![](/img/emoji/beerparrot.gif)`
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 {

Loading…
Cancel
Save