mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge pull request #1865 from deciare/edit-message-macros
Parse macros when updating message
This commit is contained in:
@@ -5967,7 +5967,11 @@ function updateMessage(div) {
|
|||||||
text = text.trim();
|
text = text.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
const bias = extractMessageBias(text);
|
const bias = substituteParams(extractMessageBias(text));
|
||||||
|
text = substituteParams(text);
|
||||||
|
if (bias) {
|
||||||
|
text = removeMacros(text);
|
||||||
|
}
|
||||||
mes['mes'] = text;
|
mes['mes'] = text;
|
||||||
if (mes['swipe_id'] !== undefined) {
|
if (mes['swipe_id'] !== undefined) {
|
||||||
mes['swipes'][mes['swipe_id']] = text;
|
mes['swipes'][mes['swipe_id']] = text;
|
||||||
@@ -6010,7 +6014,7 @@ function openMessageDelete(fromSlashCommand) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function messageEditAuto(div) {
|
function messageEditAuto(div) {
|
||||||
const { mesBlock, text, mes } = updateMessage(div);
|
const { mesBlock, text, mes, bias } = updateMessage(div);
|
||||||
|
|
||||||
mesBlock.find('.mes_text').val('');
|
mesBlock.find('.mes_text').val('');
|
||||||
mesBlock.find('.mes_text').val(messageFormatting(
|
mesBlock.find('.mes_text').val(messageFormatting(
|
||||||
@@ -6020,6 +6024,8 @@ function messageEditAuto(div) {
|
|||||||
mes.is_user,
|
mes.is_user,
|
||||||
this_edit_mes_id,
|
this_edit_mes_id,
|
||||||
));
|
));
|
||||||
|
mesBlock.find('.mes_bias').empty();
|
||||||
|
mesBlock.find('.mes_bias').append(messageFormatting(bias, '', false, false, -1));
|
||||||
saveChatDebounced();
|
saveChatDebounced();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user