Commit 6c95acc8 by AJ West

Switch to global match for full browser support of escaped custom vars

parent 2b3d366f
...@@ -39,7 +39,7 @@ export class CustomVariable implements Variable { ...@@ -39,7 +39,7 @@ export class CustomVariable implements Variable {
updateOptions() { updateOptions() {
// extract options in comma separated string (use backslash to escape wanted commas) // extract options in comma separated string (use backslash to escape wanted commas)
this.options = _.map(this.query.split(/(?<!\\),+/), text => { this.options = _.map(this.query.match(/(?:\\,|[^,])+/g), text => {
text = text.replace('\\,', ','); text = text.replace('\\,', ',');
return { text: text.trim(), value: text.trim() }; return { text: text.trim(), value: text.trim() };
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment