Expand alignment span

This commit is contained in:
M66B 2020-10-03 16:56:59 +02:00
parent e9e656f763
commit 64f9f59c9f
1 changed files with 6 additions and 1 deletions

View File

@ -2324,10 +2324,15 @@ public class HtmlHelper {
int f = flags.get(spans[i]);
if (spans[i] instanceof AlignmentSpan ||
spans[i] instanceof BulletSpan ||
spans[i] instanceof NumberSpan)
spans[i] instanceof NumberSpan) {
if (spans[i] instanceof AlignmentSpan &&
!(e > 1 && 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')
f |= Spanned.SPAN_PARAGRAPH;
}
ssb.setSpan(spans[i], s, e, f);
}