Fix the tag span generation for tags with nonascii characters (#2700)
* Update mention and tag regexes from mastodon * Normalize nonascii tag names the same way that mastodon does
This commit is contained in:
parent
687cffd540
commit
5d09a67b52
5 changed files with 44 additions and 3 deletions
|
|
@ -124,7 +124,7 @@ fun setClickableText(
|
|||
|
||||
@VisibleForTesting
|
||||
fun getTagName(text: CharSequence, tags: List<HashTag>?): String? {
|
||||
val scrapedName = text.subSequence(1, text.length).toString()
|
||||
val scrapedName = normalizeToASCII(text.subSequence(1, text.length)).toString()
|
||||
return when (tags) {
|
||||
null -> scrapedName
|
||||
else -> tags.firstOrNull { it.name.equals(scrapedName, true) }?.name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue