1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-27 16:33:47 +00:00

Fixed pasting plain text

This commit is contained in:
M66B 2019-12-27 12:34:01 +01:00
parent b2724c35db
commit d51a51d16a

View file

@ -71,7 +71,9 @@ public class EditTextCompose extends AppCompatEditText {
if (clipboard.hasPrimaryClip()) {
ClipData.Item item = clipboard.getPrimaryClip().getItemAt(0);
String html = item.coerceToHtmlText(context);
String html = item.getHtmlText();
if (html == null)
html = "<div>" + HtmlHelper.formatPre(item.getText().toString()) + "</div>";
Document document = HtmlHelper.sanitize(context, html, false, false);
Spanned paste = HtmlHelper.fromHtml(document.html());