helper: str replace function should replace all instances of placeholder
This commit is contained in:
parent
31545c758d
commit
bc7e7888a5
1 changed files with 2 additions and 1 deletions
|
@ -75,7 +75,8 @@ function localStorageTest() {
|
||||||
|
|
||||||
function listReplace(s, subst) {
|
function listReplace(s, subst) {
|
||||||
for (key in subst) {
|
for (key in subst) {
|
||||||
s = s.replace(key, subst[key])
|
var re = new RegExp(key, 'g');
|
||||||
|
s = s.replace(re, subst[key])
|
||||||
}
|
}
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue