mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Revert old quote wrapping for code blocks
This commit is contained in:
@ -1045,7 +1045,7 @@ function messageFormatting(mes, ch_name, isSystem, isUser) {
|
||||
if (power_user.auto_fix_generated_markdown) {
|
||||
mes = fixMarkdown(mes);
|
||||
}
|
||||
|
||||
|
||||
if (this_chid != undefined && !isSystem)
|
||||
mes = mes.replaceAll("<", "<").replaceAll(">", ">"); //for welcome message
|
||||
if ((this_chid === undefined || this_chid === "invalid-safety-id") && !selected_group) {
|
||||
@ -1053,7 +1053,15 @@ function messageFormatting(mes, ch_name, isSystem, isUser) {
|
||||
.replace(/\*\*(.+?)\*\*/g, "<b>$1</b>")
|
||||
.replace(/\n/g, "<br/>");
|
||||
} else if (!isSystem) {
|
||||
mes = mes.replace(/\".+?\"|\u201C.+?\u201D/gm, '<q>$&</q>') // Wrap quotes in <q>
|
||||
mes = mes.replace(/```[\s\S]*?```|``[\s\S]*?``|`[\s\S]*?`|(\".+?\")|(\u201C.+?\u201D)/gm, function (match, p1, p2) {
|
||||
if (p1) {
|
||||
return '<q>"' + p1.replace(/\"/g, "") + '"</q>';
|
||||
} else if (p2) {
|
||||
return '<q>“' + p2.replace(/\u201C|\u201D/g, "") + '”</q>';
|
||||
} else {
|
||||
return match;
|
||||
}
|
||||
});
|
||||
|
||||
mes = mes.replaceAll('\\begin{align*}', '$$');
|
||||
mes = mes.replaceAll('\\end{align*}', '$$');
|
||||
|
Reference in New Issue
Block a user