File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ def extract_linkedin_url(text: str) -> str | None:
156
156
linkedin_url = f"https://{ cleaned } "
157
157
158
158
if not re .match (
159
- r"^https://([\w-]+\.)?linkedin\.com/in/(?:[\w\-]|%[0-9A-Fa-f]{2})+$" ,
159
+ r"^https://([\w-]+\.)?linkedin\.com/in/(?:[\w\-]|%[0-9A-Fa-f]{2})+(?:/[\w\-]+)* $" ,
160
160
linkedin_url ,
161
161
):
162
162
print (f"Invalid LinkedIn URL: { linkedin_url } " )
Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ def test_extract_mastodon_url(input_string, result):
50
50
"https://regional.linkedin.com/in/example" ,
51
51
"https://regional.linkedin.com/in/example" ,
52
52
),
53
+ ("in/user123/nl" , "https://linkedin.com/in/user123/nl" ),
54
+ ("https://nl.linkedin.com/in/user123/en" , "https://nl.linkedin.com/in/user123/en" ),
53
55
],
54
56
)
55
57
def test_extract_linkedin_url (input_string , result ):
You can’t perform that action at this time.
0 commit comments