mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Move trimToEnd at the end of message clean-up
This commit is contained in:
@@ -5345,17 +5345,10 @@ export function cleanUpMessage(getMessage, isImpersonate, isContinue, displayInc
|
|||||||
// Regex uses vars, so add before formatting
|
// Regex uses vars, so add before formatting
|
||||||
getMessage = getRegexedString(getMessage, isImpersonate ? regex_placement.USER_INPUT : regex_placement.AI_OUTPUT);
|
getMessage = getRegexedString(getMessage, isImpersonate ? regex_placement.USER_INPUT : regex_placement.AI_OUTPUT);
|
||||||
|
|
||||||
if (!displayIncompleteSentences && power_user.trim_sentences) {
|
|
||||||
getMessage = trimToEndSentence(getMessage, power_user.include_newline);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (power_user.collapse_newlines) {
|
if (power_user.collapse_newlines) {
|
||||||
getMessage = collapseNewlines(getMessage);
|
getMessage = collapseNewlines(getMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (power_user.trim_spaces) {
|
|
||||||
getMessage = getMessage.trim();
|
|
||||||
}
|
|
||||||
// trailing invisible whitespace before every newlines, on a multiline string
|
// trailing invisible whitespace before every newlines, on a multiline string
|
||||||
// "trailing whitespace on newlines \nevery line of the string \n?sample text" ->
|
// "trailing whitespace on newlines \nevery line of the string \n?sample text" ->
|
||||||
// "trailing whitespace on newlines\nevery line of the string\nsample text"
|
// "trailing whitespace on newlines\nevery line of the string\nsample text"
|
||||||
@@ -5447,6 +5440,14 @@ export function cleanUpMessage(getMessage, isImpersonate, isContinue, displayInc
|
|||||||
getMessage = getMessage.trim();
|
getMessage = getMessage.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!displayIncompleteSentences && power_user.trim_sentences) {
|
||||||
|
getMessage = trimToEndSentence(getMessage, power_user.include_newline);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (power_user.trim_spaces) {
|
||||||
|
getMessage = getMessage.trim();
|
||||||
|
}
|
||||||
|
|
||||||
return getMessage;
|
return getMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user