2017-09-16 15:01:15 +02:00
|
|
|
import { urlRegex } from './url_regex';
|
|
|
|
|
2021-03-02 12:02:56 +01:00
|
|
|
const urlPlaceholder = '$2xxxxxxxxxxxxxxxxxxxxxxx';
|
2017-07-29 00:06:29 +02:00
|
|
|
|
|
|
|
export function countableText(inputText) {
|
|
|
|
return inputText
|
2017-09-16 15:01:15 +02:00
|
|
|
.replace(urlRegex, urlPlaceholder)
|
2017-11-07 19:08:14 +01:00
|
|
|
.replace(/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '$1@$3');
|
2022-12-18 16:51:37 +01:00
|
|
|
}
|