You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
276 B
10 lines
276 B
7 years ago
|
import { urlRegex } from './url_regex';
|
||
|
|
||
4 years ago
|
const urlPlaceholder = '$2xxxxxxxxxxxxxxxxxxxxxxx';
|
||
7 years ago
|
|
||
|
export function countableText(inputText) {
|
||
|
return inputText
|
||
7 years ago
|
.replace(urlRegex, urlPlaceholder)
|
||
7 years ago
|
.replace(/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '$1@$3');
|
||
7 years ago
|
};
|