escape quotes inside quoted option value
This commit is contained in:
parent
676472f13d
commit
aefa31a912
|
@ -369,7 +369,7 @@ export class AutoComplete {
|
||||||
// update replacer and add quotes if necessary
|
// update replacer and add quotes if necessary
|
||||||
const optionName = option.valueProvider ? option.valueProvider(this.name) : option.name;
|
const optionName = option.valueProvider ? option.valueProvider(this.name) : option.name;
|
||||||
if (this.effectiveParserResult.canBeQuoted) {
|
if (this.effectiveParserResult.canBeQuoted) {
|
||||||
option.replacer = optionName.includes(' ') || this.startQuote || this.endQuote ? `"${optionName}"` : `${optionName}`;
|
option.replacer = optionName.includes(' ') || this.startQuote || this.endQuote ? `"${optionName.replace(/"/g, '\\"')}"` : `${optionName}`;
|
||||||
} else {
|
} else {
|
||||||
option.replacer = optionName;
|
option.replacer = optionName;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue