You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android: link stitching assumes sorted, non-overlapping links #36
// android/.../TextClassifier.kt:94,136val textBefore = text.substring(previousEnd, currentLink.start)
val textAfter = text.substring(links.last().end)
Both assume links arrive sorted by start offset and do not overlap. TextLinks.getLinks() returns a Collection with no documented ordering guarantee, so an out-of-order link throws StringIndexOutOfBoundsException.
iOS is safe here because NSDataDetector returns matches in order.
Fix:links.sortedBy { it.start } before the loop, and skip any link that starts before previousEnd.
Activity