Allow escaped quoted args on split args too

This commit is contained in:
Wolfsblvt 2024-09-30 17:49:52 +02:00
parent 010af89a72
commit 0dfebbbe52

View File

@ -1053,9 +1053,9 @@ export class SlashCommandParser {
if (split && splitCount && listValues.length >= splitCount) {
// the split count has just been reached: stop splitting, the rest is one singular value
split = false;
if (this.testQuotedValue()) {
if (this.testEscapedQuotedValue()) {
// if the next bit is a quoted value, take the whole value
assignment.value = this.parseQuotedValue();
assignment.value = this.parseEscapedQuotedValue();
assignment.end = this.index;
listValues.push(assignment);
listQuoted.push(true);
@ -1072,9 +1072,9 @@ export class SlashCommandParser {
listQuoted.push(false);
assignment = new SlashCommandUnnamedArgumentAssignment();
assignment.start = this.index;
if (!split && this.testQuotedValue()) {
if (!split && this.testEscapedQuotedValue()) {
// if where currently not splitting and the next bit is a quoted value, take the whole value
assignment.value = this.parseQuotedValue();
assignment.value = this.parseEscapedQuotedValue();
assignment.end = this.index;
listValues.push(assignment);
listQuoted.push(true);
@ -1092,9 +1092,9 @@ export class SlashCommandParser {
assignment.start = this.index;
if (split) this.discardWhitespace();
} else if (split) {
if (this.testQuotedValue()) {
if (this.testEscapedQuotedValue()) {
assignment.start = this.index;
assignment.value = this.parseQuotedValue();
assignment.value = this.parseEscapedQuotedValue();
assignment.end = this.index;
listValues.push(assignment);
listQuoted.push(true);