correct URL pattern used in text length counter in WebUI (#4968)

This commit is contained in:
ふぁぼ原 2017-09-16 22:01:15 +09:00 committed by Eugen Rochko
parent c30e6433de
commit 629fae8b3b
2 changed files with 199 additions and 1 deletions

View file

@ -1,7 +1,9 @@
import { urlRegex } from './url_regex';
const urlPlaceholder = 'xxxxxxxxxxxxxxxxxxxxxxx';
export function countableText(inputText) {
return inputText
.replace(/https?:\/\/\S+/g, urlPlaceholder)
.replace(urlRegex, urlPlaceholder)
.replace(/(?:^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+)/ig, '@$2');
};