1
0
Fork 0
mirror of synced 2024-06-15 00:44:41 +12:00

replace all handlebars bindings, not just the first

This commit is contained in:
Maurits Lourens 2021-09-21 09:57:14 +02:00
parent c91e5ea39c
commit a5b5b102fd

View file

@ -443,7 +443,10 @@ function bindingReplacement(bindableProperties, textWithBindings, convertTo) {
for (let from of convertFromProps) {
if (shouldReplaceBinding(newBoundValue, from, convertTo)) {
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)