]> cat aescling's git repositories - mastodon.git/commitdiff
Reduce discrepancies between server and client-side character count (#5360)
authorThibG <thib@sitedethib.com>
Thu, 12 Oct 2017 21:26:34 +0000 (23:26 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 12 Oct 2017 21:26:34 +0000 (23:26 +0200)
app/javascript/mastodon/features/compose/util/counter.js

index 588a372c6edde8d32b50cc6b30928846a8537e36..e6d2487c59c15de76419dbc61d0a21ead6d38890 100644 (file)
@@ -5,5 +5,5 @@ const urlPlaceholder = 'xxxxxxxxxxxxxxxxxxxxxxx';
 export function countableText(inputText) {
   return inputText
     .replace(urlRegex, urlPlaceholder)
-    .replace(/(?:^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+)/ig, '@$2');
+    .replace(/(?:^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '@$2');
 };