fix(jobdanmark-search): accept a comma after the postcode in location extraction

The location regex required whitespace after the 4-digit postcode, but
live companyAddress values frequently read "2670, Greve" - those results
emitted location: null (7/30 in the review's live sample; 1/30 after this
fix), leaving /scrape's geography filter nothing to act on. Extraction is
now a helper with a comma fallback that requires a non-digit city start,
so a 4-digit street number never wins over the real postcode, and the
captured city is trimmed. Review finding F2 (2026-08-19).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mads Lorentzen
2026-08-19 19:46:34 +02:00
co-authored by Claude Opus 5
parent b2545d5121
commit 7aba0b4a9d
3 changed files with 47 additions and 1 deletions
+7
View File
@@ -56,6 +56,13 @@ per-file diff commands.
### Fixed
- **`jobdanmark-search` extracts the city when a comma follows the postcode** - the
`location` regex required whitespace after the 4-digit postcode, but live
`companyAddress` values frequently read `"2670, Greve"`; those results emitted
`location: null` (7 of 30 in a live sample), so `/scrape`'s geography/commute filter
(Rule 3) had nothing to act on. The extraction now accepts an optional comma, trims the
captured city, and still refuses to mistake a 4-digit street number for the postcode.
Pinned by three new cases in `tests/search-normalization.test.ts`.
- **Example-CV bullets no longer swallowed as LaTeX optional labels** - every placeholder
bullet written as `\item [text]` (11 in `cv/main_example.tex`, 3 in
`06-cover-letter-templates.md`'s taught template) let LaTeX parse the bracketed text as