japandotorg / Seina-Cogs

My public cogs for red.
https://seina-cogs.readthedocs.io/en/latest/
Other
16 stars 19 forks source link

[AntiLinks] Match URLs Like x.com #41

Closed mario31274 closed 10 months ago

mario31274 commented 11 months ago

The original regex wouldn't match URLs that only have one character before .xxx, such as x.com. I simply add a ? after [\d\w] to make the regex accept domain names started with a single character.

Since Twitter registered x.com as its alternative domain name, many people would use links starting with x.com, and AntiLinks would fail to remove such links (Thanks, Elon!)

Not sure if this change would break other URL matching, but I tested with some other links without encountering any problems.

japandotorg commented 10 months ago

LGTM!

Thanks for the PR!