mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-01-11 10:12:56 -05:00
[Glitch] Exclude URLs from text analysis
Port e974d4923fabd887416609bc6c8ca81ce81d0ff2 to glitch-soc Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
parent
a869572aab
commit
bd0bde1da2
@ -20,6 +20,7 @@ export function isRtl(text) {
|
|||||||
text = text.replace(/(?:^|[^\/\w])@([a-z0-9_]+(@[a-z0-9\.\-]+)?)/ig, '');
|
text = text.replace(/(?:^|[^\/\w])@([a-z0-9_]+(@[a-z0-9\.\-]+)?)/ig, '');
|
||||||
text = text.replace(/(?:^|[^\/\w])#([\S]+)/ig, '');
|
text = text.replace(/(?:^|[^\/\w])#([\S]+)/ig, '');
|
||||||
text = text.replace(/\s+/g, '');
|
text = text.replace(/\s+/g, '');
|
||||||
|
text = text.replace(/(\w\S+\.\w{2,}\S*)/g, '');
|
||||||
|
|
||||||
const matches = text.match(rtlChars);
|
const matches = text.match(rtlChars);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user