How can I automatically censor specific links in new posts?
The best solution for me would be censoring links. But the current “Censor” function hides only visible text and the link is working as if it wasn’t censored.
And when onebox is activated then Cersoring doesn’t work completely - nothing is hidden.
Thanks, Jay! But the idea is to auto change censored words and links. That’s strange that Discourse censors words in plain text and doesn’t change URL addresses.
Out of curiosity, if you have community members that are in the habit of “Spamming” links that are inappropriate for your community, why are they still members of your community? On the surface, this seems more like a moderation issue…
We do moderation but it takes time and is manual work.
I’d like to use a regex pattern to destroy specific links. Can anybody help me to construct a regex pattern for a link like this?
[text phrases](link to any page on a specific domain)
In my case [text phrases] may have different text versions and I would leave it original.
I need to hide only this part: (link to a page on a specific domain) where the domain is always the same, but the length and text of the link may be different.
The result should be like this:
[text phrases]■■■■■■■■■■■■■■■■■■■■■■■■
I found the topic, that previously censor function worked the way I need, but lately was changed: Censored words out of a URL
Created a regex pattern (\[.*?\])\(https?://((www\.site\.com)).*/?\)
When I test it in “Test ‘Censor’ Watched Words”, the system finds the necessary part.
But it doesn’t work when I add the text to be replaced in the post.
What may cause it?
Another problem is that there is a restriction of the expression length - no more than 50 characters. Is it possible to increase it?