mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'dev' of https://github.com/Cohee1207/SillyTavern into dev
This commit is contained in:
@ -1062,12 +1062,18 @@ function messageFormatting(mes, ch_name, isSystem, isUser) {
|
||||
return match;
|
||||
}
|
||||
});
|
||||
|
||||
mes = mes.replaceAll('\\begin{align*}', '$$');
|
||||
mes = mes.replaceAll('\\end{align*}', '$$');
|
||||
mes = converter.makeHtml(mes);
|
||||
mes = mes.replace(/{{(\*?.*\*?)}}/g, "");
|
||||
|
||||
mes = mes.replace(/<code(.*)>[\s\S]*?<\/code>/g, function (match) {
|
||||
// Firefox creates extra newlines from <br>s in code blocks, so we replace them before converting newlines to <br>s.
|
||||
return match.replace(/\n/gm, '\u0000');
|
||||
})
|
||||
mes = mes.replace(/\n/g, "<br/>");
|
||||
mes = mes.replace(/\u0000/g, "\n"); // Restore converted newlines
|
||||
mes = mes.trim();
|
||||
|
||||
mes = mes.replace(/<code(.*)>[\s\S]*?<\/code>/g, function (match) {
|
||||
|
Reference in New Issue
Block a user