Commit 13575706 authored by Thomas's avatar Thomas
Browse files

Fix an issue

parent bbbc8e00
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -94,7 +94,6 @@ public class SpannableHelper {
    private static Spannable convert(@NonNull Context context, @NonNull Status status, String text) {
        return convert(context, status, text, true);
    }

    /**
     * Convert HTML content to text. Also, it handles click on link and transform emoji
     * This needs to be run asynchronously
@@ -1144,7 +1143,14 @@ public class SpannableHelper {
        if (text == null) {
            return null;
        }
        if (!limitedToDisplayName) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
                initialContent = new SpannableString(Html.fromHtml(text, Html.FROM_HTML_MODE_LEGACY));
            else
                initialContent = new SpannableString(Html.fromHtml(text));
        } else {
            initialContent = new SpannableString(text);
        }
        SpannableStringBuilder content = new SpannableStringBuilder(initialContent);
        URLSpan[] urls = content.getSpans(0, (content.length() - 1), URLSpan.class);
        for (URLSpan span : urls)