Thunderbird style plain text formatting

This commit is contained in:
M66B 2021-02-21 16:05:33 +01:00
parent 4eb91ca061
commit 168b1f3638
1 changed files with 10 additions and 3 deletions

View File

@ -1796,14 +1796,21 @@ public class HtmlHelper {
int start = ssb.getSpanStart(span);
int end = ssb.getSpanEnd(span);
if (span.getStyle() == Typeface.ITALIC) {
ssb.insert(end, "/");
ssb.insert(start, "/");
} else if (span.getStyle() == Typeface.BOLD) {
ssb.insert(end, "*");
ssb.insert(start, "*");
} else if (span.getStyle() == Typeface.BOLD) {
ssb.insert(end, "**");
ssb.insert(start, "**");
}
}
for (UnderlineSpan span : ssb.getSpans(0, ssb.length(), UnderlineSpan.class)) {
int start = ssb.getSpanStart(span);
int end = ssb.getSpanEnd(span);
ssb.insert(end, "_");
ssb.insert(start, "_");
}
for (URLSpan span : ssb.getSpans(0, ssb.length(), URLSpan.class)) {
String url = span.getURL();
if (TextUtils.isEmpty(url))