Optimization

pull/216/head
M66B 2 months ago
parent 4fd89437f2
commit 60ab18a84b

@ -2644,30 +2644,31 @@ public class HtmlHelper {
boolean preview_hidden = prefs.getBoolean("preview_hidden", true); boolean preview_hidden = prefs.getBoolean("preview_hidden", true);
boolean preview_quotes = prefs.getBoolean("preview_quotes", true); boolean preview_quotes = prefs.getBoolean("preview_quotes", true);
for (Element e : d.select("*")) { if (!preview_hidden)
String style = e.attr("style"); for (Element e : d.select("*")) {
if (TextUtils.isEmpty(style)) String style = e.attr("style");
continue; if (TextUtils.isEmpty(style))
String[] params = style.split(";");
for (String param : params) {
int colon = param.indexOf(':');
if (colon <= 0)
continue; continue;
String key = param.substring(0, colon)
.trim() String[] params = style.split(";");
.toLowerCase(Locale.ROOT); for (String param : params) {
String value = param.substring(colon + 1) int colon = param.indexOf(':');
.replace("!important", "") if (colon <= 0)
.trim() continue;
.toLowerCase(Locale.ROOT) String key = param.substring(0, colon)
.replaceAll("\\s+", " "); .trim()
if (!preview_hidden && "display".equals(key) && "none".equals(value)) { .toLowerCase(Locale.ROOT);
e.remove(); String value = param.substring(colon + 1)
break; .replace("!important", "")
.trim()
.toLowerCase(Locale.ROOT)
.replaceAll("\\s+", " ");
if ("display".equals(key) && "none".equals(value)) {
e.remove();
break;
}
} }
} }
}
if (!preview_quotes) { if (!preview_quotes) {
if (!removeQuotes(d, false)) { if (!removeQuotes(d, false)) {

Loading…
Cancel
Save