Prechádzať zdrojové kódy

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

AJ West 7 rokov pred
rodič
commit
6c95acc837

+ 1 - 1
public/app/features/templating/custom_variable.ts

@@ -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() };
     });