Browse Source

Merge pull request #15980 from srid12/custom-variable-issue-15921

used regex instead of string replacing
Torkel Ödegaard 6 years ago
parent
commit
bfc84c0f2b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      public/app/features/templating/custom_variable.ts

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

@@ -40,7 +40,7 @@ export class CustomVariable implements Variable {
   updateOptions() {
     // extract options in comma separated string (use backslash to escape wanted commas)
     this.options = _.map(this.query.match(/(?:\\,|[^,])+/g), text => {
-      text = text.replace('\\,', ',');
+      text = text.replace(/\\,/g, ',');
       return { text: text.trim(), value: text.trim() };
     });