Skip to content

Commit

Permalink
fix to enable links in markdown
Browse files Browse the repository at this point in the history
fix to enable links in markdown when no top level domain was included in the link description

This will disable automatic link parsing for hyperlinks, numbers, email address,...

Signed-off-by: Marcel Hibbe <[email protected]>
  • Loading branch information
mahibi committed May 7, 2024
1 parent 073587b commit fe18bb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import android.content.Intent
import android.net.Uri
import android.text.SpannableString
import android.text.Spanned
import android.util.Log
import android.view.View
import androidx.core.content.ContextCompat.startActivity
import com.nextcloud.talk.R
import com.nextcloud.talk.models.json.chat.ChatMessage
import com.nextcloud.talk.ui.theme.ViewThemeUtils
Expand Down Expand Up @@ -155,8 +155,12 @@ class MessageUtils(val context: Context) {
}

override fun configureConfiguration(builder: MarkwonConfiguration.Builder) {
builder.linkResolver { view: View?, link: String? ->
Log.i(TAG, "Link action not implemented $view / $link")
builder.linkResolver { _: View?, link: String? ->
val urlIntent = Intent(
Intent.ACTION_VIEW,
Uri.parse(link)
)
startActivity(context, urlIntent, null)
}
}
})
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/activity_chat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@
app:outcomingTextLinkColor="@color/high_emphasis_text"
app:outcomingTextSize="@dimen/chat_text_size"
app:outcomingTimeTextSize="12sp"
app:textAutoLink="all"
tools:visibility="visible" />

<com.nextcloud.ui.popupbubble.PopupBubble
Expand Down

0 comments on commit fe18bb4

Please sign in to comment.