Loading k9mail/src/main/java/com/fsck/k9/message/html/HtmlSanitizer.java +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ public class HtmlSanitizer { HtmlSanitizer() { Whitelist whitelist = Whitelist.relaxed() .addTags("font") .addTags("font", "hr") .addAttributes("table", "align", "bgcolor", "border", "cellpadding", "cellspacing", "width") .addAttributes(":all", "class", "style", "id") .addProtocols("img", "src", "http", "https", "cid", "data"); Loading k9mail/src/test/java/com/fsck/k9/message/html/HtmlSanitizerTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -158,4 +158,13 @@ public class HtmlSanitizerTest { "<tr><td>Hmailserver service shutdown:</td><td>Ok</td></tr>" + "</tbody></table></body></html>", toCompactString(result)); } @Test public void shouldKeepHrTags() throws Exception { String html = "<html><head></head><body>one<hr>two<hr />three</body></html>"; Document result = htmlSanitizer.sanitize(html); assertEquals("<html><head></head><body>one<hr>two<hr>three</body></html>", toCompactString(result)); } } Loading
k9mail/src/main/java/com/fsck/k9/message/html/HtmlSanitizer.java +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ public class HtmlSanitizer { HtmlSanitizer() { Whitelist whitelist = Whitelist.relaxed() .addTags("font") .addTags("font", "hr") .addAttributes("table", "align", "bgcolor", "border", "cellpadding", "cellspacing", "width") .addAttributes(":all", "class", "style", "id") .addProtocols("img", "src", "http", "https", "cid", "data"); Loading
k9mail/src/test/java/com/fsck/k9/message/html/HtmlSanitizerTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -158,4 +158,13 @@ public class HtmlSanitizerTest { "<tr><td>Hmailserver service shutdown:</td><td>Ok</td></tr>" + "</tbody></table></body></html>", toCompactString(result)); } @Test public void shouldKeepHrTags() throws Exception { String html = "<html><head></head><body>one<hr>two<hr />three</body></html>"; Document result = htmlSanitizer.sanitize(html); assertEquals("<html><head></head><body>one<hr>two<hr>three</body></html>", toCompactString(result)); } }