Skip to content

Commit 271a6c7

Browse files
committed
Validate author slug requires vol.issue prefix pattern
Reject bare numbers like '25' from archive URLs that were incorrectly matched as newsletter slugs.
1 parent 5efed43 commit 271a6c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/import_newsletter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ def extract_author_slug(text):
108108
slug = slug.rsplit('/', 1)[-1]
109109
# Strip redundant SmartDrivingCar.Com- prefix (dash variant)
110110
slug = re.sub(r'^smartdrivingcar\.com-', '', slug, flags=re.IGNORECASE)
111-
if slug:
111+
# Validate: must look like a newsletter slug (vol.issue prefix, e.g. "13.17-...")
112+
if slug and re.match(r'^\d+\.\d+', slug):
112113
return slug
113114
return None
114115

0 commit comments

Comments
 (0)