1
0
Fork 0
mirror of synced 2024-09-30 09:07:25 +13:00

Merge pull request #2686 from mslourens/replace_all_handlebars_bindings

replace all handlebars bindings, not just the first
This commit is contained in:
Michael Drury 2021-09-22 11:44:17 +01:00 committed by GitHub
commit 26ea796935
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)