2020-04-07 21:06:59 -04:00
|
|
|
import { urlRegex } from './url_regex'
|
2019-07-02 03:10:25 -04:00
|
|
|
|
2020-04-07 21:06:59 -04:00
|
|
|
const urlPlaceholder = 'xxxxxxxxxxxxxxxxxxxxxxx'
|
2019-07-02 03:10:25 -04: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-07 21:06:59 -04:00
|
|
|
}
|