From 2e88988fcecfc0a7a66e89a2da9cb65d3aa89944 Mon Sep 17 00:00:00 2001 From: ThibG Date: Thu, 12 Oct 2017 23:26:34 +0200 Subject: [PATCH] Reduce discrepancies between server and client-side character count (#5360) --- app/javascript/mastodon/features/compose/util/counter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/mastodon/features/compose/util/counter.js b/app/javascript/mastodon/features/compose/util/counter.js index 588a372c6e..e6d2487c59 100644 --- a/app/javascript/mastodon/features/compose/util/counter.js +++ b/app/javascript/mastodon/features/compose/util/counter.js @@ -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'); };