forked from MapComplete/MapComplete
First working version with multi-rendering
This commit is contained in:
parent
b9b8a5c71a
commit
0c0ef48a96
16 changed files with 228 additions and 135 deletions
8
Utils.ts
8
Utils.ts
|
@ -165,8 +165,10 @@ export class Utils {
|
|||
return [a.substr(0, index), a.substr(index + sep.length)];
|
||||
}
|
||||
|
||||
public static SubstituteKeys(txt: string, tags: any) {
|
||||
|
||||
public static SubstituteKeys(txt: string | undefined, tags: any): string | undefined {
|
||||
if (txt === undefined) {
|
||||
return undefined
|
||||
}
|
||||
const regex = /.*{([^}]*)}.*/
|
||||
|
||||
let match = txt.match(regex)
|
||||
|
@ -176,7 +178,7 @@ export class Utils {
|
|||
txt = txt.replace("{" + key + "}", tags[key] ?? "")
|
||||
match = txt.match(regex)
|
||||
}
|
||||
|
||||
|
||||
return txt;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue