1
0
Fork 0
mirror of synced 2024-06-01 18:20:18 +12:00

Fix regex binding replacement issue due to not being escaped

This commit is contained in:
Andrew Kingston 2021-09-24 16:24:16 +01:00
parent ae0a4a14f8
commit 1bb964ca31

View file

@ -443,10 +443,9 @@ 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(
new RegExp(from, "gi"),
binding[convertTo]
)
while (newBoundValue.includes(from)) {
newBoundValue = newBoundValue.replace(from, binding[convertTo])
}
}
}
result = result.replace(boundValue, newBoundValue)