[Glitch] Exclude URLs from text analysis

Port 6899564a76 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
lolsob-rspec
Mostafa Ahangarha 2019-09-05 01:00:49 +04:30 committed by Thibaut Girka
parent f0806c8de1
commit 1eef666521
1 changed files with 1 additions and 0 deletions

View File

@ -20,6 +20,7 @@ export function isRtl(text) {
text = text.replace(/(?:^|[^\/\w])@([a-z0-9_]+(@[a-z0-9\.\-]+)?)/ig, '');
text = text.replace(/(?:^|[^\/\w])#([\S]+)/ig, '');
text = text.replace(/\s+/g, '');
text = text.replace(/(\w\S+\.\w{2,}\S*)/g, '');
const matches = text.match(rtlChars);