From bd0bde1da2279b21b10c10a9ddbee6ea49282c28 Mon Sep 17 00:00:00 2001 From: Mostafa Ahangarha Date: Thu, 5 Sep 2019 01:00:49 +0430 Subject: [PATCH] [Glitch] Exclude URLs from text analysis Port e974d4923fabd887416609bc6c8ca81ce81d0ff2 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/util/rtl.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/javascript/flavours/glitch/util/rtl.js b/app/javascript/flavours/glitch/util/rtl.js index 00870a15d67..89bed6de888 100644 --- a/app/javascript/flavours/glitch/util/rtl.js +++ b/app/javascript/flavours/glitch/util/rtl.js @@ -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);