diff --git a/public/script.js b/public/script.js index 362fff888..a64473b41 100644 --- a/public/script.js +++ b/public/script.js @@ -984,7 +984,7 @@ function messageFormatting(mes, ch_name, isSystem, isUser) { mes = mes.replaceAll('\\begin{align*}', '$$'); mes = mes.replaceAll('\\end{align*}', '$$'); mes = converter.makeHtml(mes); - mes = mes.replace(/{{(\*?.+?\*?)}}/g, ""); + mes = mes.replace(/{{(\*?.*\*?)}}/g, ""); mes = mes.replace(/\n/g, "
"); mes = mes.trim(); @@ -1272,7 +1272,7 @@ function extractMessageBias(message) { } const found = []; - const rxp = /{{(\*?.+?\*?)}}/g; + const rxp = /{{(\*?.+\*?)}}/g; //const rxp = /{([^}]+)}/g; let curMatch; @@ -1282,7 +1282,7 @@ function extractMessageBias(message) { if (!found.length) { // cancels a bias - if (message.includes('{') && message.includes('}')) { + if (message.includes('{{') && message.includes('}}')) { return ''; } return null; @@ -1765,7 +1765,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject, // replace bias markup //chat2[i] = (chat2[i] ?? '').replace(/{.*}/g, ''); - chat2[i] = (chat2[i] ?? '').replace(/{{(\*?.+?\*?)}}/g, ''); + chat2[i] = (chat2[i] ?? '').replace(/{{(\*?.*\*?)}}/g, ''); //console.log('replacing chat2 {}s'); } //chat2 = chat2.reverse(); diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 6692553ba..94cb2d6ac 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -167,7 +167,7 @@ function setOpenAIMessages(chat, quietPrompt) { // replace bias markup //content = (content ?? '').replace(/{.*}/g, ''); - content = (content ?? '').replace(/{{(\*?.+?\*?)}}/g, ''); + content = (content ?? '').replace(/{{(\*?.*\*?)}}/g, ''); content = content.replace(/\r/gm, '');