Skip to content

Commit

Permalink
fix hidden url markup when link text contains 🔗 (#4650)
Browse files Browse the repository at this point in the history
Found a post that had a link that contained a 🔗 in the link text, which
tripped up our algorithm.
https://toot.mirbsd.org/@fefes_blog/statuses/01J6YVRNW9C3Q6GBCWKT96CYD0

Before / After

<img
src="https://github.com/user-attachments/assets/b2ce6f0c-7ae2-4351-86f9-2564252e9a62"
width="280"/>
<img
src="https://github.com/user-attachments/assets/589ffe6d-e57e-4c2e-bd82-b01ef178d551"
width="280"/>
  • Loading branch information
connyduck authored Sep 9, 2024
1 parent 56955eb commit 4f135c7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fun markupHiddenUrls(view: TextView, content: CharSequence): SpannableStringBuil
val linkDrawableSpan = EmojiSpan(view)
linkDrawableSpan.imageDrawable = linkDrawable

val placeholderIndex = replacementText.indexOf("🔗")
val placeholderIndex = originalText.length + 2

spannableContent.setSpan(
linkDrawableSpan,
Expand Down

0 comments on commit 4f135c7

Please sign in to comment.