فهرست منبع

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

AJ West 7 سال پیش
والد
کامیت
6c95acc837
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      public/app/features/templating/custom_variable.ts

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