From 3ef1cb233fb1fa9d7609b0e35024e3281df9bf89 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 11 Nov 2020 16:58:38 +0100 Subject: [PATCH] Optional heading separator lines --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 12 ++++++++++-- 1 file changed, 10 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 42636b4f65..4dfd8db915 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -753,8 +753,16 @@ public class HtmlHelper { } // Replace headings - if (!text_size) - document.select("h1,h2,h3,h4,h5,h6").tagName("strong"); + Elements hs = document.select("h1,h2,h3,h4,h5,h6"); + if (text_size) { + if (text_separators && view) + for (Element h : hs) + h.appendElement("hr") + .attr("x-block", "true"); + else + hs.attr("x-line-after", "true"); + } else + hs.tagName("strong"); // Paragraphs for (Element p : document.select("p")) {