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