Revert "Fix backward compatibility with escaped leading quote" This reverts commit deb13e9c97dcf724fff3342f69b6ad0f27ca936b.

bdcf9b088e3369023a69c909aa25fd9b95b0ab57

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -11Ignore whitespace
public/scripts/slash-commands/SlashCommandParser.js+2 -11
@@ -566,10 +566,9 @@ export class SlashCommandParser {
566566 * Expects that the current char is taken after testing.
567567 * @param {string|RegExp} sequence Sequence of chars or regex character group that is the symbol.
568568 * @param {number} offset Offset from the current index (won't move the index if offset != 0).
569- * @param {boolean} escape Whether to escape the symbol with backslashes.
570569 * @returns Whether the next characters are the indicated symbol.
571570 */
572571 testSymbol(sequence, offset = 0, escape = true) {
573572 if (!this.flags[PARSER_FLAG.STRICT_ESCAPING]) return this.testSymbolLooseyGoosey(sequence, offset);
574573 // /echo abc | /echo def
575574 // -> TOAST: abc
@@ -588,7 +587,7 @@ export class SlashCommandParser {
588587 // -> TOAST: *:}* {:
589588 // -> TOAST: *{:* :}
590589 const escapeOffset = this.jumpedEscapeSequence ? -1 : 0;
591590 const escapes = escape ? this.text.slice(this.index + offset + escapeOffset).replace(/^(\\*).*$/s, '$1').length : 0;
592591 const test = (sequence instanceof RegExp) ?
593592 (text) => new RegExp(`^${sequence.source}`).test(text) :
594593 (text) => text.startsWith(sequence)
@@ -1046,9 +1045,6 @@ export class SlashCommandParser {
10461045 /**@type {SlashCommandUnnamedArgumentAssignment}*/
10471046 let assignment = new SlashCommandUnnamedArgumentAssignment();
10481047 assignment.start = this.index;
1049- if (rawQuotes && this.testEscapedQuote()) {
1050- this.take(); // discard the escaping backslash
1051- }
10521048 if (!split && !rawQuotes && this.testQuotedValue()) {
10531049 // if the next bit is a quoted value, take the whole value and gather contents as a list
10541050 assignment.value = this.parseQuotedValue();
@@ -1191,11 +1187,6 @@ export class SlashCommandParser {
11911187 testQuotedValue() {
11921188 return this.testSymbol('"');
11931189 }
1194-
1195- testEscapedQuote() {
1196- return this.testSymbol('\\"', 0, false);
1197- }
1198-
11991190 testQuotedValueEnd() {
12001191 if (this.endOfText) {
12011192 if (this.verifyCommandNames) throw new SlashCommandParserError(`Unexpected end of quoted value at position ${this.index}`, this.text, this.index);