Fix text-area type, support for newlines in key substitutions (fix #543), small tweaks to etymology-theme (fix #537)

This commit is contained in:
Pieter Vander Vennet 2021-11-07 18:37:42 +01:00
parent 7839712deb
commit fdb769a0fc
6 changed files with 19 additions and 10 deletions

View file

@ -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)
}