mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #15980 from srid12/custom-variable-issue-15921
used regex instead of string replacing
This commit is contained in:
commit
bfc84c0f2b
@ -40,7 +40,7 @@ export class CustomVariable implements Variable {
|
|||||||
updateOptions() {
|
updateOptions() {
|
||||||
// extract options in comma separated string (use backslash to escape wanted commas)
|
// extract options in comma separated string (use backslash to escape wanted commas)
|
||||||
this.options = _.map(this.query.match(/(?:\\,|[^,])+/g), text => {
|
this.options = _.map(this.query.match(/(?:\\,|[^,])+/g), text => {
|
||||||
text = text.replace('\\,', ',');
|
text = text.replace(/\\,/g, ',');
|
||||||
return { text: text.trim(), value: text.trim() };
|
return { text: text.trim(), value: text.trim() };
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user