소스 검색

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