mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-29 19:40:23 -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');
|
|
};
|