Added fail safes

pull/217/head
M66B 10 months ago
parent 5046dcf3f4
commit 7bb58be0c2

@ -1739,7 +1739,8 @@ public class HtmlHelper {
String ns = null; String ns = null;
for (Element h : parsed.select("html")) for (Element h : parsed.select("html"))
for (Attribute a : h.attributes()) { for (Attribute a : h.attributes())
try {
String key = a.getKey(); String key = a.getKey();
String value = a.getValue().toLowerCase(Locale.ROOT); String value = a.getValue().toLowerCase(Locale.ROOT);
if ("xmlns".equals(key) && value.contains(W3NS)) { if ("xmlns".equals(key) && value.contains(W3NS)) {
@ -1749,9 +1750,12 @@ public class HtmlHelper {
ns = key.split(":")[1]; ns = key.split(":")[1];
break; break;
} }
} catch (Throwable ex) {
Log.e(ex);
} }
for (Element e : parsed.select("*")) { for (Element e : parsed.select("*"))
try {
String tag = e.tagName(); String tag = e.tagName();
if (tag.contains(":")) { if (tag.contains(":")) {
boolean show = (ns == null || tag.startsWith(ns) || boolean show = (ns == null || tag.startsWith(ns) ||
@ -1793,6 +1797,8 @@ public class HtmlHelper {
} }
} }
} }
} catch (Throwable ex) {
Log.e(ex);
} }
} }

Loading…
Cancel
Save