Browse Source

SpanUtils: highlight nicknames with dashes (#2061)

While it's not allowed to create such accounts on Mastodon, it federates fine with servers that allow dashes.
pull/2058/head
Alibek Omarov 5 years ago committed by GitHub
parent
commit
b00aa9b461
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/src/main/java/com/keylesspalace/tusky/util/SpanUtils.kt

2
app/src/main/java/com/keylesspalace/tusky/util/SpanUtils.kt

@ -18,7 +18,7 @@ private const val TAG_REGEX = "(?:^|[^/)A-Za-z0-9_])#([\\w_]*[\\p{Alpha}_][\\w_]
* @see <a href="https://github.com/tootsuite/mastodon/blob/master/app/models/account.rb">
* Account#MENTION_RE</a>
*/
private const val MENTION_REGEX = "(?:^|[^/[:word:]])@([a-z0-9_]+(?:@[a-z0-9\\.\\-]+[a-z0-9]+)?)"
private const val MENTION_REGEX = "(?:^|[^/[:word:]])@([a-z0-9_-]+(?:@[a-z0-9\\.\\-]+[a-z0-9]+)?)"
private const val HTTP_URL_REGEX = "(?:(^|\\b)http://[^\\s]+)"
private const val HTTPS_URL_REGEX = "(?:(^|\\b)https://[^\\s]+)"

Loading…
Cancel
Save