From cf0525611188f1ddd1d650912f8fd65b56a585e2 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 14 Nov 2020 19:48:34 +0100 Subject: [PATCH] Improved debugging --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 6c02635b54..a6b7ed2c5b 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -2404,13 +2404,17 @@ public class HtmlHelper { }, document.body()); if (debug) - for (int i = ssb.length() - 1; i >= 0; i--) - if (ssb.charAt(i) == '\n') + for (int i = ssb.length() - 1; i >= 0; i--) { + char kar = ssb.charAt(i); + if (kar == '\n') ssb.insert(i, "|"); - else if (ssb.charAt(i) == ' ') + else if (kar == ' ') ssb.replace(i, i + 1, "_"); - else if (ssb.charAt(i) == '\u00A0') + else if (kar == '\u00A0') ssb.replace(i, i + 1, "•"); + else if (!Character.isLetterOrDigit(kar)) + ssb.replace(i, i + 1, "{" + Integer.toHexString((int) kar) + "}"); + } Object[] spans = ssb.getSpans(0, ssb.length(), Object.class); Map start = new HashMap<>();