japandotorg / Seina-Cogs

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

[AntiLinks] Match URLs Like x.com #41

Closed mario31274 closed 8 months ago

mario31274 commented 9 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 8 months ago

LGTM!

Thanks for the PR!