diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-07-31 15:19:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-31 15:19:48 +0200 |
commit | c7cc8062512193543ee7c55fd0acfc54b6ec5a65 (patch) | |
tree | 866543a6ab28ecac73aea62d646bc0ad730699e9 /app/javascript | |
parent | 82b4cf4acb9a2c6fb84bf56a87d918831960308c (diff) |
Simplify web UI character counter logic (#4463)
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/mastodon/features/compose/util/counter.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/compose/util/counter.js b/app/javascript/mastodon/features/compose/util/counter.js index 589e85460..f0fea1a0e 100644 --- a/app/javascript/mastodon/features/compose/util/counter.js +++ b/app/javascript/mastodon/features/compose/util/counter.js @@ -2,6 +2,6 @@ const urlPlaceholder = 'xxxxxxxxxxxxxxxxxxxxxxx'; export function countableText(inputText) { return inputText - .replace(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g, urlPlaceholder) + .replace(/https?:\/\/\S+/g, urlPlaceholder) .replace(/(?:^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+)/ig, '@$2'); }; |