mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
remove empty first string and last string from unsplit list-parsed unnamed argument
This commit is contained in:
@ -946,10 +946,16 @@ export class SlashCommandParser {
|
||||
const firstVal = listValues[0];
|
||||
if (typeof firstVal.value == 'string') {
|
||||
firstVal.value = firstVal.value.trimStart();
|
||||
if (firstVal.value.length == 0) {
|
||||
listValues.shift();
|
||||
}
|
||||
}
|
||||
const lastVal = listValues.slice(-1)[0];
|
||||
if (typeof lastVal.value == 'string') {
|
||||
lastVal.value = lastVal.value.trimEnd();
|
||||
if (lastVal.value.length == 0) {
|
||||
listValues.pop();
|
||||
}
|
||||
}
|
||||
return listValues;
|
||||
}
|
||||
|
Reference in New Issue
Block a user