Samuel
@samuel.fm
@dholms.xyz mind if I just rip out your hasExplicitSlur function wholesale?
2 11Yup yup totally 👍
The actually regexes come from another repo credited in a comment (they asked for credit) so copy over the comment to :)
1 19Cool cool, will do :)
1 2i havent looked at the bsky code for this but i recommend homoglyph folding to make your life easier
2 6srsly tho interesting stuff, I wonder if I should be running a library like this on my usernames? I could imagine that there's an avenue for error if someone uses a weird character but then when you try and access the subdomain it gets changed
https://www.npmjs.com/package/idna-uts46
npm: idna-uts46
A UTS #46 processing algorithm for IDNA2008 strings. Latest version: 1.1.0, last published: 6 years ago. Start using idna-uts46 in your project by running `npm i idna-uts46`. There are 8 other project...
npmjs.com
I glanced at it and I'm pretty sure I saw some big homoglyph lists
1 6yeah I think some reddit mod just typed out some enormous regexes for their automod config
2 6Yeah also it came to my attention that all these Unicode characters aren’t even allowed in handles cause they’re ascii 😅
So you can probs do something way simpler. Just wanna take into account letter substitutions like l/1 for i, etc
1 12i generally prefer to run a pass over a string to fold characters into what they could look like as letters. like f00 -> foo and then your regex only has to match /foo/ rather than /f[o0][o0]/
1 6check out the worst regexes you've ever seen in your life (for multiple reasons)
https://github.com/Blank-Cheque/Slurs/tree/master/verbose
Slurs/verbose at master · Blank-Cheque/Slurs
Regex slur detectors for automod. Contribute to Blank-Cheque/Slurs development by creating an account on GitHub.
github.com
I mean, it's MIT licensed, right?
1 8yeah but polite to ask :)
1 5It might just be me being a grumpy weirdo (extremely possible) but I get tired of people asking me if they can use things which I already explicitly designated as freely usable. I do like a heads-up though ("hey I'm using [thing] for [project], ty")
obviously I can't speak for dholms though
1 10(not saying this to have a go at your or anything, it's just a weird little pet peeve of mine and I went off on a bit of a tangent heh)
1 5