Forking glitch theme
This commit is contained in:
9
app/javascript/themes/glitch/util/counter.js
Normal file
9
app/javascript/themes/glitch/util/counter.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import { urlRegex } from './url_regex';
|
||||
|
||||
const urlPlaceholder = 'xxxxxxxxxxxxxxxxxxxxxxx';
|
||||
|
||||
export function countableText(inputText) {
|
||||
return inputText
|
||||
.replace(urlRegex, urlPlaceholder)
|
||||
.replace(/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '$1@$3');
|
||||
};
|
||||
Reference in New Issue
Block a user