Support full html in system messages. Closes #747 (#814)

This commit is contained in:
Gabe Kangas
2021-03-12 00:43:10 -08:00
committed by GitHub
parent c67a3e8299
commit 6f545a905b
5 changed files with 24 additions and 12 deletions

View File

@@ -52,3 +52,14 @@ func TestAllowEmojiImages(t *testing.T) {
t.Errorf("message rendering/sanitation does not match expected. Got\n%s, \n\n want:\n%s", result, expected)
}
}
// Test to verify we can pass raw html and render markdown.
func TestAllowHTML(t *testing.T) {
messageContent := `<img src="/img/emoji/beerparrot.gif"><ul><li>**test thing**</li></ul>`
expected := "<p><img src=\"/img/emoji/beerparrot.gif\"><ul><li><strong>test thing</strong></li></ul></p>\n"
result := models.RenderMarkdown(messageContent)
if result != expected {
t.Errorf("message rendering does not match expected. Got\n%s, \n\n want:\n%s", result, expected)
}
}