mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-16 13:14:17 -05:00
8 lines
233 B
JavaScript
8 lines
233 B
JavaScript
const urlPlaceholder = 'xxxxxxxxxxxxxxxxxxxxxxx';
|
|
|
|
export function countableText(inputText) {
|
|
return inputText
|
|
.replace(/https?:\/\/\S+/g, urlPlaceholder)
|
|
.replace(/(?:^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+)/ig, '@$2');
|
|
};
|