Skip to content

Commit 1b8cf4d

Browse files
committed
Fix Bluesky
1 parent 9f585f7 commit 1b8cf4d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/models/europython.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ def extract_bluesky_url(text: str) -> str:
136136
if text.startswith("www."):
137137
text = text[4:]
138138

139+
# Remove @ if present
140+
if text.startswith("@"):
141+
text = text[1:]
142+
139143
for marker in ("bsky.app/profile/", "bsky/"):
140144
if marker in text:
141145
text = text.split(marker, 1)[1]

tests/test_social_media_extractions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def test_extract_linkedin_url(input_string: str, result: str) -> None:
3838
("input_string", "result"),
3939
[
4040
("username", "https://bsky.app/profile/username.bsky.social"),
41+
("@username", "https://bsky.app/profile/username.bsky.social"),
4142
("username.dev", "https://bsky.app/profile/username.dev"),
43+
("@username.dev", "https://bsky.app/profile/username.dev"),
4244
("username.bsky.social", "https://bsky.app/profile/username.bsky.social"),
4345
("bsky.app/profile/username", "https://bsky.app/profile/username.bsky.social"),
4446
("bsky/username", "https://bsky.app/profile/username.bsky.social"),

0 commit comments

Comments
 (0)