Merge pull request #2686 from mslourens/replace_all_handlebars_bindings
replace all handlebars bindings, not just the first
This commit is contained in:
commit
7b80e2a8e3
|
@ -443,7 +443,10 @@ function bindingReplacement(bindableProperties, textWithBindings, convertTo) {
|
||||||
for (let from of convertFromProps) {
|
for (let from of convertFromProps) {
|
||||||
if (shouldReplaceBinding(newBoundValue, from, convertTo)) {
|
if (shouldReplaceBinding(newBoundValue, from, convertTo)) {
|
||||||
const binding = bindableProperties.find(el => el[convertFrom] === from)
|
const binding = bindableProperties.find(el => el[convertFrom] === from)
|
||||||
newBoundValue = newBoundValue.replace(from, binding[convertTo])
|
newBoundValue = newBoundValue.replace(
|
||||||
|
new RegExp(from, "gi"),
|
||||||
|
binding[convertTo]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = result.replace(boundValue, newBoundValue)
|
result = result.replace(boundValue, newBoundValue)
|
||||||
|
|
Loading…
Reference in New Issue