瀏覽代碼

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