Updated quote tagging

Quote tagging now works with left and right side specific quote mark characters as well.
This commit is contained in:
Halsey1006
2023-05-07 02:11:14 -07:00
committed by GitHub
parent 1a9039649b
commit 012bca112e

View File

@ -961,13 +961,15 @@ function messageFormatting(mes, ch_name, isSystem, isUser) {
.replace(/\*\*(.+?)\*\*/g, "<b>$1</b>") .replace(/\*\*(.+?)\*\*/g, "<b>$1</b>")
.replace(/\n/g, "<br/>"); .replace(/\n/g, "<br/>");
} else if (!isSystem) { } else if (!isSystem) {
mes = mes.replace(/```[\s\S]*?```|``[\s\S]*?``|`[\s\S]*?`|(\".+?\")/gm, function (match, p1) { mes = mes.replace(/```[\s\S]*?```|``[\s\S]*?``|`[\s\S]*?`|(\".+?\")|(\u201C.+?\u201D)/gm, function (match, p1, p2) {
if (p1) { if (p1) {
return '<q>"' + p1.replace(/\"/g, "") + '"</q>'; return '<q>"' + p1.replace(/\"/g, "") + '"</q>';
} else { } else if (p2) {
return match; return '<q>“' + p2.replace(/\u201C|\u201D/g, "") + '”</q>';
} } else {
}); return match;
}
});
mes = mes.replaceAll('\\begin{align*}', '$$'); mes = mes.replaceAll('\\begin{align*}', '$$');
mes = mes.replaceAll('\\end{align*}', '$$'); mes = mes.replaceAll('\\end{align*}', '$$');
mes = converter.makeHtml(mes); mes = converter.makeHtml(mes);