couetilc / react-social-icons

svg social icons in react

Home Page:https://react-social-icons.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

X.com icon used for any domain that has `x` in it

orels1 opened this issue Β· comments

Hey! Just wanted to say thanks for keeping this library maintained all this time, it's been very helpful over the years πŸ™

What is happening

With the recent v6 release and addition of the x.com support - any domain that has x in it is now treated as x.com.

E.g. if you use https://tlx.dev it will be marked with x.com's icon and not with a generic link icon.

I looked at the code and it seems like the issue comes primarily from the fact that the generator doesn't utilize tlds in the search, so it results in a regex like this being constructed

(?:https?:\/\/(?:[a-z0-9-])?)?(x)[.]

Which would match anything with an x

image

What is the desired result

It feels like the matcher should also include the tld so then it will not grab unrelated websites like that.

@orels1 Thank you for the kind words. The issue has been addressed in v6.4.0