From c7ef1501df8bd373bcd0c856fda0bcabb871b901 Mon Sep 17 00:00:00 2001 From: Przemek Wiech Date: Tue, 4 Feb 2020 18:01:08 +0100 Subject: [PATCH] WikiTree: Handle last nams with spaces --- src/wikitree.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wikitree.ts b/src/wikitree.ts index ef1d151..8026c6d 100644 --- a/src/wikitree.ts +++ b/src/wikitree.ts @@ -383,6 +383,8 @@ function parseDate(date: string, dataStatus?: string) { function buildGedcom(indis: JsonIndi[]): GedcomData { const gedcomIndis: {[key: string]: GedcomEntry} = {}; indis.forEach((indi) => { + // WikiTree URLs replace spaces with underscores. + const escapedId = indi.id.replace(' ', '_'); gedcomIndis[indi.id] = { level: 0, pointer: `@${indi.id}@`, @@ -400,7 +402,7 @@ function buildGedcom(indis: JsonIndi[]): GedcomData { level: 1, pointer: '', tag: 'WWW', - data: `https://www.wikitree.com/wiki/${indi.id}`, + data: `https://www.wikitree.com/wiki/${escapedId}`, tree: [], }, ],