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

This commit is contained in:
AJ West
2018-12-08 18:23:08 -05:00
parent 2b3d366f7c
commit 6c95acc837

View File

@@ -39,7 +39,7 @@ export class CustomVariable implements Variable {
updateOptions() {
// 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('\\,', ',');
return { text: text.trim(), value: text.trim() };
});