formula: better regexp (no need to escape object closing brackets)

This commit is contained in:
jean-emmanuel 2018-10-16 12:29:03 +02:00
parent 2ca4ff2715
commit 20128b3327
3 changed files with 4 additions and 3 deletions

View file

@ -456,9 +456,10 @@ class Widget extends EventEmitter {
})
try {
propValue = propValue.replace(/#\{(?:[^}\\]|\\.)+\}/g, (m)=>{
propValue = propValue.replace(/#\{(?:[^{}]|\{[^{}]*\})*\}/g, (m)=>{
// one bracket nesting allowed, if we need two: #\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}
// unescape brackets
// unescape brackets (not needed anymore, just here for backward compatibility)
m = m.replace(/\\(\{|\})/g, '$1')
// espace multiline strings