forked from MapComplete/MapComplete
Fix text-area type, support for newlines in key substitutions (fix #543), small tweaks to etymology-theme (fix #537)
This commit is contained in:
parent
7839712deb
commit
fdb769a0fc
6 changed files with 19 additions and 10 deletions
9
Utils.ts
9
Utils.ts
|
@ -186,7 +186,14 @@ Note that these values can be prepare with javascript in the theme by using a [c
|
|||
|
||||
while (match) {
|
||||
const key = match[1]
|
||||
txt = txt.replace("{" + key + "}", tags[key] ?? "")
|
||||
let v = tags[key]
|
||||
if(v !== undefined ){
|
||||
if(typeof v !== "string"){
|
||||
v = ""+v
|
||||
}
|
||||
v = v.replace(/\n/g, "<br/>")
|
||||
}
|
||||
txt = txt.replace("{" + key + "}", v ?? "")
|
||||
match = txt.match(regex)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue