From 7bddcbdb2557441f308268ba29785238f8b4bf22 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 2 Nov 2020 09:03:57 +0100 Subject: [PATCH] Keep preformatted text in signatures, etc --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 13a3427c15..a776ab4033 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -1931,7 +1931,8 @@ public class HtmlHelper { block.add((TextNode) node); } else if (node instanceof Element) { element = (Element) node; - if ("true".equals(element.attr("x-plain"))) + if ("pre".equals(element.tagName()) || + "true".equals(element.attr("x-plain"))) plain++; if (element.isBlock()) { normalizeText(block); @@ -1944,7 +1945,8 @@ public class HtmlHelper { public void tail(Node node, int depth) { if (node instanceof Element) { element = (Element) node; - if ("true".equals(element.attr("x-plain"))) + if ("pre".equals(element.tagName()) || + "true".equals(element.attr("x-plain"))) plain--; if (element.isBlock() || "br".equals(element.tagName())) { normalizeText(block);