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