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