gkucmierz / social-links

Validate & sanitize social links
https://npmjs.com/package/social-links
MIT License
28 stars 14 forks source link

Local LinkedIn Urls #49

Closed abegehr closed 1 year ago

abegehr commented 1 year ago

LinkedIn URLs are sometimes localized. For example if you search for me on Google, you'll get this link: https://de.linkedin.com/in/anton-begehr/. socialLinks.detectProfile() detects LinkedIn profiles on subdomain www correctly but fails on the de subdomain:

> socialLinks.detectProfile('https://www.linkedin.com/in/johndoe')
'linkedin'
> socialLinks.detectProfile('https://de.linkedin.com/in/johndoe')
''
gkucmierz commented 1 year ago

This should work in version #1.10.1

 {
      match: '(https?://)?([a-z]{2,3}.)?linkedin.com/in/({PROFILE_ID})/?', group: 3, type: TYPE_DESKTOP,
      pattern: 'https://linkedin.com/in/{PROFILE_ID}'
    },
    {
      match: '(https?://)?([a-z]{2,3}.)?linkedin.com/mwlite/in/({PROFILE_ID})/?', group: 3, type: TYPE_MOBILE,
      pattern: 'https://linkedin.com/mwlite/in/{PROFILE_ID}'
    },