]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Exclude URLs from text analysis
authorMostafa Ahangarha <ahangarha@users.noreply.github.com>
Wed, 4 Sep 2019 20:30:49 +0000 (01:00 +0430)
committerThibaut Girka <thib@sitedethib.com>
Thu, 5 Sep 2019 12:13:03 +0000 (14:13 +0200)
Port e974d4923fabd887416609bc6c8ca81ce81d0ff2 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/util/rtl.js

index 00870a15d677b48498a70bd12f22fc6d745494b3..89bed6de88811a5be77b99fbee174c7276898f67 100644 (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);