Move trimToEnd at the end of message clean-up

87dd120ec0782e0bcec21f0e6ea78d5d62cbe4d0

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

1 files changed, +8 -7Ignore whitespace
public/script.js+8 -7
@@ -5345,17 +5345,10 @@ export function cleanUpMessage(getMessage, isImpersonate, isContinue, displayInc
5345 // Regex uses vars, so add before formatting5345 // Regex uses vars, so add before formatting
5346 getMessage = getRegexedString(getMessage, isImpersonate ? regex_placement.USER_INPUT : regex_placement.AI_OUTPUT);5346 getMessage = getRegexedString(getMessage, isImpersonate ? regex_placement.USER_INPUT : regex_placement.AI_OUTPUT);
53475347
5348 if (!displayIncompleteSentences && power_user.trim_sentences) {
5349 getMessage = trimToEndSentence(getMessage, power_user.include_newline);
5350 }
5351
5352 if (power_user.collapse_newlines) {5348 if (power_user.collapse_newlines) {
5353 getMessage = collapseNewlines(getMessage);5349 getMessage = collapseNewlines(getMessage);
5354 }5350 }
53555351
5356 if (power_user.trim_spaces) {
5357 getMessage = getMessage.trim();
5358 }
5359 // trailing invisible whitespace before every newlines, on a multiline string5352 // trailing invisible whitespace before every newlines, on a multiline string
5360 // "trailing whitespace on newlines \nevery line of the string \n?sample text" ->5353 // "trailing whitespace on newlines \nevery line of the string \n?sample text" ->
5361 // "trailing whitespace on newlines\nevery line of the string\nsample text"5354 // "trailing whitespace on newlines\nevery line of the string\nsample text"
@@ -5447,6 +5440,14 @@ export function cleanUpMessage(getMessage, isImpersonate, isContinue, displayInc
5447 getMessage = getMessage.trim();5440 getMessage = getMessage.trim();
5448 }5441 }
54495442
5443 if (!displayIncompleteSentences && power_user.trim_sentences) {
5444 getMessage = trimToEndSentence(getMessage, power_user.include_newline);
5445 }
5446
5447 if (power_user.trim_spaces) {
5448 getMessage = getMessage.trim();
5449 }
5450
5450 return getMessage;5451 return getMessage;
5451}5452}
54525453