diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index de802b4596..ae5bd3cf67 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -458,14 +458,18 @@ public class HtmlHelper { // Font for (Element font : document.select("font")) { // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font + String style = font.attr("style"); String color = font.attr("color"); String size = font.attr("size"); + style = style.trim(); + if (!TextUtils.isEmpty(style) && !style.endsWith(";")) + style += ";"; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) font.removeAttr("color"); font.removeAttr("size"); - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(style); if (!TextUtils.isEmpty(color)) sb.append("color:").append(color).append(";"); @@ -1924,6 +1928,9 @@ public class HtmlHelper { case "em": ssb.setSpan(new StyleSpan(Typeface.ITALIC), start, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); break; + case "font": + // Do nothing + break; case "h1": case "h2": case "h3":