Merge pull request #1025 from StefanDanielSchwarz/Comment-Message-Formatting
comment message formatting
This commit is contained in:
commit
7931cd9b17
|
@ -136,7 +136,7 @@ import {
|
||||||
} from "./scripts/utils.js";
|
} from "./scripts/utils.js";
|
||||||
|
|
||||||
import { extension_settings, getContext, loadExtensionSettings, processExtensionHelpers, registerExtensionHelper, runGenerationInterceptors, saveMetadataDebounced } from "./scripts/extensions.js";
|
import { extension_settings, getContext, loadExtensionSettings, processExtensionHelpers, registerExtensionHelper, runGenerationInterceptors, saveMetadataDebounced } from "./scripts/extensions.js";
|
||||||
import { executeSlashCommands, getSlashCommandsHelp, registerSlashCommand } from "./scripts/slash-commands.js";
|
import { COMMENT_NAME_DEFAULT, executeSlashCommands, getSlashCommandsHelp, registerSlashCommand } from "./scripts/slash-commands.js";
|
||||||
import {
|
import {
|
||||||
tag_map,
|
tag_map,
|
||||||
tags,
|
tags,
|
||||||
|
@ -1199,6 +1199,11 @@ function messageFormatting(mes, ch_name, isSystem, isUser) {
|
||||||
mes = '';
|
mes = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Force isSystem = false on comment messages so they get formatted properly
|
||||||
|
if (ch_name === COMMENT_NAME_DEFAULT && isSystem && !isUser) {
|
||||||
|
isSystem = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Prompt bias replacement should be applied on the raw message
|
// Prompt bias replacement should be applied on the raw message
|
||||||
if (!power_user.show_user_prompt_bias && ch_name && !isUser && !isSystem) {
|
if (!power_user.show_user_prompt_bias && ch_name && !isUser && !isSystem) {
|
||||||
mes = mes.replaceAll(substituteParams(power_user.user_prompt_bias), "");
|
mes = mes.replaceAll(substituteParams(power_user.user_prompt_bias), "");
|
||||||
|
|
|
@ -131,7 +131,7 @@ parser.addCommand('send', sendUserMessageCallback, ['add'], '<span class="monosp
|
||||||
|
|
||||||
const NARRATOR_NAME_KEY = 'narrator_name';
|
const NARRATOR_NAME_KEY = 'narrator_name';
|
||||||
const NARRATOR_NAME_DEFAULT = 'System';
|
const NARRATOR_NAME_DEFAULT = 'System';
|
||||||
const COMMENT_NAME_DEFAULT = 'Note';
|
export const COMMENT_NAME_DEFAULT = 'Note';
|
||||||
|
|
||||||
async function sendUserMessageCallback(_, text) {
|
async function sendUserMessageCallback(_, text) {
|
||||||
if (!text) {
|
if (!text) {
|
||||||
|
|
Loading…
Reference in New Issue