mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
fix issue with markdown links
This commit is contained in:
@@ -394,11 +394,13 @@ public class ConversationItem extends LinearLayout
|
||||
bodyText.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
Spannable spannable = (Spannable)markwon.toMarkdown(text);
|
||||
if (batchSelected.isEmpty()) {
|
||||
Spannable spannable = (Spannable)markwon.toMarkdown(text);
|
||||
spannable = EmojiTextView.linkify(spannable);
|
||||
bodyText.setText(spannable);
|
||||
} else {
|
||||
bodyText.setText(text);
|
||||
}
|
||||
bodyText.setText(spannable);
|
||||
bodyText.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -227,9 +227,8 @@ public class EmojiTextView extends AppCompatTextView {
|
||||
public static Spannable linkify(Spannable messageBody) {
|
||||
// linkify commands such as `/echo` -
|
||||
// do this first to avoid `/xkcd_123456` to be treated partly as a phone number
|
||||
if (Linkify.addLinks(messageBody, CMD_PATTERN, "cmd:", null, null)) {
|
||||
EmojiTextView.replaceURLSpan(messageBody); // replace URLSpan so that it is not removed on the next addLinks() call
|
||||
}
|
||||
Linkify.addLinks(messageBody, CMD_PATTERN, "cmd:", null, null);
|
||||
EmojiTextView.replaceURLSpan(messageBody); // replace URLSpan so that it is not removed on the next addLinks() call
|
||||
|
||||
// linkyfiy urls etc., this removes all existing URLSpan
|
||||
if (Linkify.addLinks(messageBody, Linkify.EMAIL_ADDRESSES|Linkify.WEB_URLS|Linkify.PHONE_NUMBERS)) {
|
||||
|
||||
Reference in New Issue
Block a user