mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
0ccb9b23cc
Patterns.WEB_URL, which LinkifyCompat uses to find links, has no production for a bracketed IPv6 authority, so a URL such as http://[2001:db8::1]:8008/path was never turned into a link. Worse, the phone number matcher claimed the digit runs inside the address, leaving a tel: link over part of it. LinkifyHelper now runs its own pass for those URLs. It requires both a scheme and the brackets, so array syntax like values[0]:1 is not matched, and it runs after LinkifyCompat.addLinks, which strips any span set before it, but before the pre-existing spans are restored, so real anchors and pill spans keep their precedence. Any span Linkify left inside the address is evicted, and the same trailing punctuation trimming as the other links is applied. Relates to https://github.com/element-hq/element-x-android/issues/2614