fix(linkedin-search): accept LinkedIn job URLs with trailing slashes in detail command (#411) (#412)

* fix(linkedin-search): accept LinkedIn job URLs with trailing slashes in detail command (#411)

* docs(changelog): record linkedin-search trailing-slash fix (#411)
This commit is contained in:
Abhinav
2026-09-01 21:35:06 +02:00
committed by GitHub
parent 4c38f7ce4c
commit 6ef295bf7b
3 changed files with 63 additions and 2 deletions
@@ -6,10 +6,10 @@ export interface DetailOpts {
}
/** Accept a raw job ID, a job-view URL, or a job URN. */
function normalizeId(input: string): string | null {
export function normalizeId(input: string): string | null {
const urn = input.match(/urn:li:jobPosting:(\d+)/)
if (urn) return urn[1]
const url = input.match(/-(\d{6,})(?:\?|$)/) || input.match(/\/(\d{6,})(?:\?|$)/)
const url = input.match(/-(\d{6,})(?:[\/?]|$)/) || input.match(/\/(\d{6,})(?:[\/?]|$)/)
if (url) return url[1]
const bare = input.match(/^\d{6,}$/)
if (bare) return input