diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 3f9b7e292a..15bab109bd 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -2570,11 +2570,11 @@ public class HtmlHelper { spans[i] instanceof BulletSpan || spans[i] instanceof NumberSpan) { if (spans[i] instanceof AlignmentSpan && - !(e > 1 && ssb.charAt(e - 1) == '\n') && + !(e > 0 && ssb.charAt(e - 1) == '\n') && e < ssb.length() && ssb.charAt(e) == '\n') e++; - if (s > 1 && ssb.charAt(s - 1) == '\n' && - e > 1 && ssb.charAt(e - 1) == '\n') + if (s > 0 && ssb.charAt(s - 1) == '\n' && + e > 0 && ssb.charAt(e - 1) == '\n') f |= Spanned.SPAN_PARAGRAPH; } ssb.setSpan(spans[i], s, e, f);