Skip to content
Snippets Groups Projects
Commit c7cc8062 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Simplify web UI character counter logic (#4463)

parent 82b4cf4a
No related branches found
No related tags found
No related merge requests found
......@@ -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');
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment