logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: c7cc8062512193543ee7c55fd0acfc54b6ec5a65
parent: 82b4cf4acb9a2c6fb84bf56a87d918831960308c
Author: Eugen Rochko <eugen@zeonfederated.com>
Date:   Mon, 31 Jul 2017 15:19:48 +0200

Simplify web UI character counter logic (#4463)


Diffstat:

Mapp/javascript/mastodon/features/compose/util/counter.js2+-
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 @@ -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'); };