From 050b2a1d3db3238c20c8175e713f5ed6378e2471 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 18 Feb 2024 19:23:51 +0100 Subject: [PATCH] Fixed comments on convert to markdown --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 55dfde05ef..cf8bd9d2d5 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -7701,7 +7701,11 @@ public class FragmentCompose extends FragmentBase { Spanned spannedBody; if (markdown) { MutableDataSet options = new MutableDataSet(); - spannedBody = new SpannableStringBuilder(FlexmarkHtmlConverter.builder(options).build().convert(doc.html())); + // HtmlConverterCoreNodeRenderer + // options.set(FlexmarkHtmlConverter.LISTS_END_ON_DOUBLE_BLANK, false); + String text = FlexmarkHtmlConverter.builder(options).build().convert(doc.html()); + text = text.replaceAll("\n.*\n\n", ""); + spannedBody = new SpannableStringBuilder(text); } else { HtmlHelper.clearAnnotations(doc); // Legacy left-overs