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
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.