diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d15c11e..568a193b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ - bug fixes - issue when resizing widget using keyboard shortcuts - - advanced syntaxes (VAR{}): avoid storing default value as string if it can be parsed as a javascript primitive (boolean, number, etc) + - advanced syntaxes (VAR{}): avoid storing default value as string if it can be parsed as a javascript primitive (boolean, number, etc) + - advanced syntaxes (VAR{}): ignore quotes around variable name - editor - change keyboard shortcuts for moving widgets (now `mod + arrows`) and navigating in widgets (now `arrows`) to feel more natural with the project tree view. diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 25dffe3f..1becd336 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -644,6 +644,12 @@ class Widget extends EventEmitter { } catch (err) {} } + if ( + // remove quotes + (name[0] === '"' && name[name.length - 1] === '"') || + (name[0] === '\'' && name[name.length - 1] === '\'') || + ) name = name.slice(1, name.length - 1) + if (!this.variables[name]) { this.variables[name] = {default: value, value: value, propNames: [propName]}