Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit f2f7b782 authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #2893 from k9mail/GH-2889_add_ins_del_html_tags_to_whitelist

Add <ins> and <del> HTML tags to whitelist
parents f366e504 b51d9d09
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ public class HtmlSanitizer {

    HtmlSanitizer() {
        Whitelist whitelist = Whitelist.relaxed()
                .addTags("font", "hr")
                .addTags("font", "hr", "ins", "del")
                .addAttributes("table", "align", "bgcolor", "border", "cellpadding", "cellspacing", "width")
                .addAttributes(":all", "class", "style", "id")
                .addProtocols("img", "src", "http", "https", "cid", "data");
+9 −0
Original line number Diff line number Diff line
@@ -167,4 +167,13 @@ public class HtmlSanitizerTest {

        assertEquals("<html><head></head><body>one<hr>two<hr>three</body></html>", toCompactString(result));
    }

    @Test
    public void shouldKeepInsDelTags() {
        String html = "<html><head></head><body><ins>Inserted</ins><del>Deleted</del></body></html>";

        Document result = htmlSanitizer.sanitize(html);

        assertEquals(html, toCompactString(result));
    }
}