fix unclosed block comment infinite loop

This commit is contained in:
LenAnderson
2024-07-20 12:00:50 -04:00
parent 4191e3fa09
commit 7ab09c6432

View File

@ -797,7 +797,12 @@ export class SlashCommandParser {
return this.testSymbol(/\/\*/);
}
testBlockCommentEnd() {
return this.testSymbol(/\*\|/);
if (!this.verifyCommandNames) {
if (this.index >= this.text.length) return true;
} else {
if (this.ahead.length < 1) throw new SlashCommandParserError(`Unclosed block comment at position ${this.userIndex}`, this.text, this.index);
}
return this.testSymbol('*|');
}
parseBlockComment() {
const start = this.index + 1;