• 1 Post
  • 7 Comments
Joined 2 years ago
cake
Cake day: July 2nd, 2023

help-circle
  • I think I may see why. I didn’t actually bother to check the main feed before, but it seems like it does have the a.community-link tag the new filter targets in every post - so if a post from leopardsatemyface ever shows up in the main feed, then the filter will think it’s on that community page and fail to block any posts. But the filter should work fine so long as no posts from that community are currently on the main feed. This should be the case regardless of which regex is used - if it wasn’t just a coincidence earlier I’ll have to test around to figure out what happened with that.

    It’s a process making a good filter, I guess - I may look into a more reliable and narrower way to achieve the desired effect later on



  • Hey! I’m pretty sure this one will work:

    infosec.pub##:not(a.community-link:matches-attr(title=/.*?leopard.*?/i)) article.row:has-text(/Trump|Elon|Musk|nazi/i):not(:has-text(/leopard/i))
    

    Where now we have three filters. If the community name matches the first regex, then nothing at all will be filtered out - and then the other two work the same as before. So any post that matches the blacklist regex will be filtered out unless it also matches the whitelist regex.

    I chose to make the first regex /.*?leopard.*?/i because my thinking is you may want to just copy/paste the other whitelist filter there for simplicity, but it might make more sense to do it like the others, like /leopardsatemyface|second community|third community|etc/i. The “title” of a community for the purpose of this filter should be whatever appears after /c/ in the URL, not counting the @lemmy.world (or whatever instance) part.



  • I’m not sure I follow - the filter seems to work as-is to me. It allows posts on both the front page and the [email protected] to bypass the filter for me.

    To be clear, it’s not only applying to the title row - the article tag it targets contains the entire post as it appears in the post feed, including the title, community name, the person who submitted it, the timestamp, etc. So if anything there contains a filtered or whitelisted word it should trigger the filter.

    I wouldn’t have necessarily expected the whitelist filter to work directly on the leopards community page, since posts on community feeds don’t include the community name, but it works anyways because, it seems, there’s a hidden mod option in the HTML with the community name in it: <div class="modal-body text-center align-middle text-body">Are you sure you want to transfer leopardsatemyface@lemmy.world to TheBat@lemmy.world?</div>