#1014 Adjust group clean-up routine

This commit is contained in:
Cohee 2023-08-25 13:46:30 +03:00
parent f48f7a98fa
commit c566af7695
1 changed files with 5 additions and 3 deletions

View File

@ -131,6 +131,7 @@ import {
isDigitsOnly,
PAGINATION_TEMPLATE,
waitUntilCondition,
escapeRegex,
} from "./scripts/utils.js";
import { extension_settings, getContext, loadExtensionSettings, processExtensionHelpers, registerExtensionHelper, runGenerationInterceptors, saveMetadataDebounced } from "./scripts/extensions.js";
@ -1883,9 +1884,10 @@ function cleanGroupMessage(getMessage) {
continue;
}
const indexOfMember = getMessage.indexOf(`${name}:`);
if (indexOfMember != -1) {
getMessage = getMessage.substr(0, indexOfMember);
const regex = new RegExp(`(^|\n)${escapeRegex(name)}:`);
const nameMatch = getMessage.match(regex);
if (nameMatch) {
getMessage = getMessage.substring(nameMatch.index + nameMatch[0].length);
}
}
}