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