WikiTree: fix ID escaping when there are multiple spaces

This commit is contained in:
Przemek Wiech
2020-02-05 00:09:57 +01:00
parent c7ef1501df
commit 74e8a19952

View File

@@ -384,7 +384,7 @@ function buildGedcom(indis: JsonIndi[]): GedcomData {
const gedcomIndis: {[key: string]: GedcomEntry} = {}; const gedcomIndis: {[key: string]: GedcomEntry} = {};
indis.forEach((indi) => { indis.forEach((indi) => {
// WikiTree URLs replace spaces with underscores. // WikiTree URLs replace spaces with underscores.
const escapedId = indi.id.replace(' ', '_'); const escapedId = indi.id.replace(/ /g, '_');
gedcomIndis[indi.id] = { gedcomIndis[indi.id] = {
level: 0, level: 0,
pointer: `@${indi.id}@`, pointer: `@${indi.id}@`,