Check for CSS styles

pull/210/head
M66B 2 years ago
parent c7fd8f1f12
commit 1ed45c4d1c

@ -2588,6 +2588,27 @@ public class HtmlHelper {
if (node instanceof Element) { if (node instanceof Element) {
Element e = (Element) node; Element e = (Element) node;
String style = e.attr("style");
if (!TextUtils.isEmpty(style)) {
String[] params = style.split(";");
for (String param : params) {
int colon = param.indexOf(':');
if (colon <= 0)
continue;
String key = param.substring(0, colon).trim();
if ("color".equalsIgnoreCase(key) ||
"background-color".equalsIgnoreCase(key) ||
"font-family".equalsIgnoreCase(key) ||
"font-size".equalsIgnoreCase(key) ||
"text-align".equalsIgnoreCase(key) ||
"text-decoration".equalsIgnoreCase(key) /* line-through */) {
Log.i("Style element=" + node + " style=" + style);
result.value = true;
return FilterResult.STOP;
}
}
}
if (STRUCTURE.contains(e.tagName())) if (STRUCTURE.contains(e.tagName()))
return FilterResult.CONTINUE; return FilterResult.CONTINUE;

Loading…
Cancel
Save