[Glitch] Exclude URLs from text analysis

Port e974d4923f to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
master
Mostafa Ahangarha 5 years ago committed by Thibaut Girka
parent a869572aab
commit bd0bde1da2
  1. 1
      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);

Loading…
Cancel
Save