diff options
author | Mostafa Ahangarha <ahangarha@users.noreply.github.com> | 2019-09-05 01:00:49 +0430 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-09-05 14:13:03 +0200 |
commit | bd0bde1da2279b21b10c10a9ddbee6ea49282c28 (patch) | |
tree | acb5ec7ddddca655fef5603714dad18ff68f3b9e /app/javascript/flavours/glitch/util | |
parent | a869572aabba1284b646109bc10fe377e6ade3fd (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/glitch/util')
-rw-r--r-- | app/javascript/flavours/glitch/util/rtl.js | 1 |
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); |