Fix bug where labels with spaces weren't being escaped when selected
This commit is contained in:
parent
5589ab1e0b
commit
aebee11884
1 changed files with 2 additions and 2 deletions
|
@ -29,7 +29,6 @@
|
|||
let escapedText = text;
|
||||
const hasSpace = text.indexOf(' ') !== -1;
|
||||
const hasDoubleQuote = text.indexOf('"') !== -1;
|
||||
const hasSingleQuote = text.indexOf('\'') !== -1;
|
||||
|
||||
// Encapsulate value with quotes if it has spaces
|
||||
// Known side effect: values's with both single and double quotes
|
||||
|
@ -37,7 +36,8 @@
|
|||
if (hasSpace) {
|
||||
if (hasDoubleQuote) {
|
||||
escapedText = `'${text}'`;
|
||||
} else if (hasSingleQuote) {
|
||||
} else {
|
||||
// Encapsulate singleQuotes or if it hasSpace
|
||||
escapedText = `"${text}"`;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue