Allow color style on all html tags

pull/162/head
M66B 5 years ago
parent 0a620eec5c
commit 1fc0ec5db7

@ -141,12 +141,12 @@ public class HtmlHelper {
.addProtocols("img", "src", "cid") .addProtocols("img", "src", "cid")
.addProtocols("img", "src", "data"); .addProtocols("img", "src", "data");
if (text_color) if (text_color)
whitelist.addAttributes("span", "style"); whitelist.addAttributes(":all", "style");
final Document document = new Cleaner(whitelist).clean(parsed); final Document document = new Cleaner(whitelist).clean(parsed);
// Sanitize span styles // Sanitize span styles
for (Element span : document.select("span")) { for (Element span : document.select("*")) {
String style = span.attr("style"); String style = span.attr("style");
if (!TextUtils.isEmpty(style)) { if (!TextUtils.isEmpty(style)) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();

Loading…
Cancel
Save