mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-03 12:47:35 +01:00
Use regex to match whitespace
This commit is contained in:
parent
e4025cb413
commit
4649c806e0
@ -478,7 +478,7 @@ export function trimToEndSentence(input, include_newline = false) {
|
||||
const char = input[i];
|
||||
|
||||
if (punctuation.has(char)) {
|
||||
if (i > 0 && (input[i - 1] === ' ' || input[i - 1] === '\n')) {
|
||||
if (i > 0 && /[\s\n]/.test(input[i - 1])) {
|
||||
last = i - 1;
|
||||
} else {
|
||||
last = i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user