Pretty print html debug

pull/162/head
M66B 6 years ago
parent 8d426f747b
commit e8b3459d2c

@ -2421,8 +2421,14 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
} }
String html = HtmlHelper.sanitize(context, body, show_images); String html = HtmlHelper.sanitize(context, body, show_images);
if (debug) if (debug) {
html += "<pre>" + Html.escapeHtml(html) + "</pre>"; Document format = Jsoup.parse(html);
format.outputSettings().prettyPrint(true).outline(true).indentAmount(1);
String[] lines = format.outerHtml().split("\\r?\\n");
for (int i = 0; i < lines.length; i++)
lines[i] = Html.escapeHtml(lines[i]);
html += "<pre>" + TextUtils.join("<br>", lines) + "</pre>";
}
Spanned spanned = HtmlHelper.fromHtml(html, new Html.ImageGetter() { Spanned spanned = HtmlHelper.fromHtml(html, new Html.ImageGetter() {
@Override @Override

Loading…
Cancel
Save