Commit 2c4b3a5c authored by Leonardo Aramaki's avatar Leonardo Aramaki

Change Patterns.WEB_URL to Patterns.AUTOLINK_WEB_URL when parsing links in...

Change Patterns.WEB_URL to Patterns.AUTOLINK_WEB_URL when parsing links in order to user an updated version of the regex to match tlds
parent 5a472099
...@@ -10,9 +10,9 @@ import android.text.Spanned ...@@ -10,9 +10,9 @@ import android.text.Spanned
import android.text.style.ClickableSpan import android.text.style.ClickableSpan
import android.text.style.ImageSpan import android.text.style.ImageSpan
import android.text.style.ReplacementSpan import android.text.style.ReplacementSpan
import android.util.Patterns
import android.view.View import android.view.View
import androidx.core.content.res.ResourcesCompat import androidx.core.content.res.ResourcesCompat
import androidx.core.util.PatternsCompat
import chat.rocket.android.R import chat.rocket.android.R
import chat.rocket.android.chatroom.ui.StrikethroughDelimiterProcessor import chat.rocket.android.chatroom.ui.StrikethroughDelimiterProcessor
import chat.rocket.android.emoji.EmojiParser import chat.rocket.android.emoji.EmojiParser
...@@ -225,7 +225,7 @@ class MessageParser @Inject constructor( ...@@ -225,7 +225,7 @@ class MessageParser @Inject constructor(
override fun visit(text: Text) { override fun visit(text: Text) {
// Replace all url links to markdown url syntax. // Replace all url links to markdown url syntax.
val matcher = Patterns.WEB_URL.matcher(builder.text()) val matcher = PatternsCompat.AUTOLINK_WEB_URL.matcher(builder.text())
val consumed = mutableListOf<String>() val consumed = mutableListOf<String>()
while (matcher.find()) { while (matcher.find()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment