2017-09-16 09:01:15 -04:00
|
|
|
import { urlRegex } from './url_regex';
|
|
|
|
|
2017-07-28 18:06:29 -04:00
|
|
|
const urlPlaceholder = 'xxxxxxxxxxxxxxxxxxxxxxx';
|
|
|
|
|
|
|
|
export function countableText(inputText) {
|
|
|
|
return inputText
|
2017-09-16 09:01:15 -04:00
|
|
|
.replace(urlRegex, urlPlaceholder)
|
2017-10-12 17:26:34 -04:00
|
|
|
.replace(/(?:^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '@$2');
|
2017-07-28 18:06:29 -04:00
|
|
|
};
|