This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2017-09-16 06:01:15 -07:00
|
|
|
import { urlRegex } from './url_regex';
|
|
|
|
|
2021-03-02 03:02:56 -08:00
|
|
|
const urlPlaceholder = '$2xxxxxxxxxxxxxxxxxxxxxxx';
|
2017-07-28 15:06:29 -07:00
|
|
|
|
|
|
|
export function countableText(inputText) {
|
|
|
|
return inputText
|
2017-09-16 06:01:15 -07:00
|
|
|
.replace(urlRegex, urlPlaceholder)
|
2023-02-13 06:12:14 -08:00
|
|
|
.replace(/(^|[^/\w])@(([a-z0-9_]+)@[a-z0-9.-]+[a-z0-9]+)/ig, '$1@$3');
|
2023-02-03 11:52:07 -08:00
|
|
|
}
|