Skip to content

Commit 6e234c4

Browse files
authored
Fix 'linkedin.*' parsing (#52)
1 parent 4b178af commit 6e234c4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/models/europython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def extract_linkedin_url(text: str) -> str:
105105
"""
106106
if text.startswith("in/"):
107107
linkedin_url = f"https://linkedin.com/{text}"
108-
elif not text.startswith(("https://", "http://", "www.")):
108+
elif not text.startswith(("https://", "http://", "www.", "linkedin.")):
109109
linkedin_url = f"https://linkedin.com/in/{text}"
110110
else:
111111
linkedin_url = (

tests/test_social_media_extractions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def test_extract_mastodon_url(input_string: str, result: str) -> None:
2323
("input_string", "result"),
2424
[
2525
("username", "https://linkedin.com/in/username"),
26+
("linkedin.com/in/username", "https://linkedin.com/in/username"),
2627
("in/username", "https://linkedin.com/in/username"),
2728
("www.linkedin.com/in/username", "https://www.linkedin.com/in/username"),
2829
("http://linkedin.com/in/username", "https://linkedin.com/in/username"),

0 commit comments

Comments
 (0)