Remove forced newline separator from group join wrappers (#3722) * Remove forced newline separator from group join wrappers * Remove unnecessary ternary * Do not trim field wrappers

7d034cba1104f8063d6f70ea35d38d892a222f37

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

Signed
1 files changed, +8 -7Ignore whitespace
public/scripts/group-chats.js+8 -7
@@ -435,16 +435,18 @@ export function getGroupCharacterCards(groupId, characterId) {
435435 * @param {string} value Value to replace
436436 * @param {string} fieldName Name of the field
437437 * @param {string} characterName Name of the character
438+ * @param {boolean} trim Whether to trim the value
438439 * @returns {string} Replaced text
439440 * */
440441 function customBaseChatReplace(value, fieldName, characterName, trim) {
441442 if (!value) {
442443 return '';
443444 }
444445
445446 // We should do the custom field name replacement first, and then run it through the normal macro engine with provided names
446447 value = value.replace(/<FIELDNAME>/gi, fieldName);
447448 returnvalue baseChatReplace(= trim ? value.trim(), name1,: characterName)value;
449+ return baseChatReplace(value, name1, characterName);
448450 }
449451
450452 /**
@@ -467,13 +469,12 @@ export function getGroupCharacterCards(groupId, characterId) {
467469 }
468470
469471 // Prepare and replace prefixes
470472 const prefix = customBaseChatReplace(group.generation_mode_join_prefix, fieldName, characterName, false);
471473 const suffix = customBaseChatReplace(group.generation_mode_join_suffix, fieldName, characterName, false);
472- const separator = power_user.instruct.wrap ? '\n' : '';
473474 // Also run the macro replacement on the actual content
474475 value = customBaseChatReplace(value, fieldName, characterName, true);
475476
476477 return `${prefix ? prefix + separator : ''}${value}${suffix ? separator + suffix : ''}`;
477478 }
478479
479480 const scenarioOverride = chat_metadata['scenario'];