From da3f35f98274761857b0d949bcd827786df67a4d Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 13 Nov 2022 18:52:12 +0100 Subject: [PATCH] Fixed formatting after inserting image --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index e5ad03a1a9..dca5220f80 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -3379,13 +3379,15 @@ public class FragmentCompose extends FragmentBase { Helper.writeText(file, doc.html()); } - return HtmlHelper.fromHtml(html, new HtmlHelper.ImageGetterEx() { + Document d = JsoupEx.parse(html); + d = HtmlHelper.sanitizeView(context, d, true); + return HtmlHelper.fromDocument(context, d, new HtmlHelper.ImageGetterEx() { @Override public Drawable getDrawable(Element element) { return ImageHelper.decodeImage(context, id, element, true, zoom, 1.0f, etBody); } - }, null, getContext()); + }, null); } @Override