prop maths: allow escaping brackets in math expressions
This commit is contained in:
parent
36cc729f5f
commit
946e144ddf
1 changed files with 3 additions and 1 deletions
|
|
@ -288,7 +288,9 @@ class Widget extends EventEmitter {
|
|||
})
|
||||
|
||||
try {
|
||||
propValue = propValue.replace(/#\{([^\}]+)\}/g, (m)=>{
|
||||
propValue = propValue.replace(/#\{(?:[^\}\\]|\\.)+\}/g, (m)=>{
|
||||
m = m.replace(/\\(\{|\})/g, '$1')
|
||||
|
||||
if (!this.parsers[m]) this.parsers[m] = math.compile(m.substr(2, m.length - 3).trim())
|
||||
|
||||
let r = this.parsers[m].eval(variables)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue