Unverified Commit 3e3af954 authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit Committed by GitHub

Merge pull request #1745 from RocketChat/fix-markdown-link-parsing

[FIX] Links not correctly being parsed
parents 0ddd70df f7edcdf7
...@@ -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