about summary refs log tree commit diff
path: root/app/javascript/flavours
diff options
context:
space:
mode:
authorMostafa Ahangarha <ahangarha@users.noreply.github.com>2019-09-05 01:00:49 +0430
committerThibaut Girka <thib@sitedethib.com>2019-09-05 14:13:03 +0200
commitbd0bde1da2279b21b10c10a9ddbee6ea49282c28 (patch)
treeacb5ec7ddddca655fef5603714dad18ff68f3b9e /app/javascript/flavours
parenta869572aabba1284b646109bc10fe377e6ade3fd (diff)
[Glitch] Exclude URLs from text analysis
Port e974d4923fabd887416609bc6c8ca81ce81d0ff2 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours')
-rw-r--r--app/javascript/flavours/glitch/util/rtl.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/util/rtl.js b/app/javascript/flavours/glitch/util/rtl.js
index 00870a15d..89bed6de8 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);