mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
trimToEndSentence: fix emoji trim after whitespace
This commit is contained in:
@ -665,9 +665,10 @@ export function trimToEndSentence(input) {
|
||||
const characters = Array.from(input);
|
||||
for (let i = characters.length - 1; i >= 0; i--) {
|
||||
const char = characters[i];
|
||||
const emoji = isEmoji(char);
|
||||
|
||||
if (punctuation.has(char) || isEmoji(char)) {
|
||||
if (i > 0 && /[\s\n]/.test(characters[i - 1])) {
|
||||
if (punctuation.has(char) || emoji) {
|
||||
if (!emoji && i > 0 && /[\s\n]/.test(characters[i - 1])) {
|
||||
last = i - 1;
|
||||
} else {
|
||||
last = i;
|
||||
|
Reference in New Issue
Block a user