mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-28 02:37:16 +00:00
Support italic/bold for plain text
This commit is contained in:
parent
c3a53af9c0
commit
fdce3dee1a
1 changed files with 12 additions and 0 deletions
|
@ -1792,6 +1792,18 @@ public class HtmlHelper {
|
|||
|
||||
SpannableStringBuilder ssb = fromDocument(context, d, null, null);
|
||||
|
||||
for (StyleSpan span : ssb.getSpans(0, ssb.length(), StyleSpan.class)) {
|
||||
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, "**");
|
||||
}
|
||||
}
|
||||
|
||||
for (URLSpan span : ssb.getSpans(0, ssb.length(), URLSpan.class)) {
|
||||
String url = span.getURL();
|
||||
if (TextUtils.isEmpty(url))
|
||||
|
|
Loading…
Reference in a new issue