mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix for quotes inside code blocks
Also added quote color to default themes.
This commit is contained in:
@ -884,8 +884,14 @@ function messageFormating(mes, ch_name, isSystem, forceAvatar) {
|
|||||||
mes = mes.replace(/{{(\*?.+?\*?)}}/g, "");
|
mes = mes.replace(/{{(\*?.+?\*?)}}/g, "");
|
||||||
|
|
||||||
|
|
||||||
mes = mes.replace(/\"(.+?)\"/g, "<q>$1</q>")
|
mes = mes.replace(/(<code[^>]*>[\s\S]*?<\/code>)|\"(.+?)\"/g, function(match, code, quote) {
|
||||||
mes = mes.replace(/\n/g, "<br/>");
|
if (code) {
|
||||||
|
return code;
|
||||||
|
} else {
|
||||||
|
return "<q>" + quote + "</q>";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mes = mes.replace(/\n/g, "<br/>");
|
||||||
mes = mes.trim();
|
mes = mes.trim();
|
||||||
|
|
||||||
mes = mes.replace(/<code(.*)>[\s\S]*?<\/code>/g, function (match) {
|
mes = mes.replace(/<code(.*)>[\s\S]*?<\/code>/g, function (match) {
|
||||||
|
8
themes/Aqua Blue.json
Normal file
8
themes/Aqua Blue.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"name": "Aqua Blue",
|
||||||
|
"blur_strength": 2,
|
||||||
|
"main_text_color": "rgba(160, 190, 190, 1)",
|
||||||
|
"italics_text_color": "rgba(170, 200, 200, 1)",
|
||||||
|
"fastui_bg_color": "rgba(7, 54, 66, 0.9)",
|
||||||
|
"blur_tint_color": "rgba(0, 43, 54, 0.8)"
|
||||||
|
}
|
8
themes/Default (Dark).json
Normal file
8
themes/Default (Dark).json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"name": "Default (Dark)",
|
||||||
|
"blur_strength": 10,
|
||||||
|
"main_text_color": "rgb(220, 220, 210)",
|
||||||
|
"italics_text_color": "rgb(175, 175, 175)",
|
||||||
|
"fastui_bg_color": "rgba(0, 0, 0, 0.9)",
|
||||||
|
"blur_tint_color": "rgba(0, 0, 0, 0.5)"
|
||||||
|
}
|
8
themes/Megumin Red.json
Normal file
8
themes/Megumin Red.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"name": "Megumin Red",
|
||||||
|
"blur_strength": 10,
|
||||||
|
"main_text_color": "rgba(230, 230, 230, 1)",
|
||||||
|
"italics_text_color": "rgba(200, 200, 200, 1)",
|
||||||
|
"fastui_bg_color": "rgba(70, 5, 5, 0.9)",
|
||||||
|
"blur_tint_color": "rgba(50, 10, 10, 0.75)"
|
||||||
|
}
|
Reference in New Issue
Block a user