2020-04-08 02:06:59 +01:00
|
|
|
import { urlRegex } from './url_regex'
|
2019-07-02 08:10:25 +01:00
|
|
|
|
2020-04-08 02:06:59 +01:00
|
|
|
const urlPlaceholder = 'xxxxxxxxxxxxxxxxxxxxxxx'
|
2019-07-02 08:10:25 +01:00
|
|
|
|
|
|
|
export function countableText(inputText) {
|
|
|
|
return inputText
|
|
|
|
.replace(urlRegex, urlPlaceholder)
|
|
|
|
.replace(/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '$1@$3');
|
2020-04-08 02:06:59 +01:00
|
|
|
}
|