From d6801975a0aee227c9e770c5ac566910371b914f Mon Sep 17 00:00:00 2001 From: Halsey1006 Date: Mon, 24 Apr 2023 17:50:42 -0700 Subject: [PATCH 1/4] Rewrote quote recolor regex Found some more issues with quote recoloring, particularly in relation to numbered lists. Tested this change a bit more thoroughly, including multiple sets of backtick-enclosed quote marks on the same line, all seems to be working properly now. --- public/script.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/script.js b/public/script.js index 3583db1c1..3da42b3fd 100644 --- a/public/script.js +++ b/public/script.js @@ -878,14 +878,17 @@ function messageFormating(mes, ch_name, isSystem, forceAvatar) { .replace(/\*\*(.+?)\*\*/g, "$1") .replace(/\n/g, "
"); } else if (!isSystem) { + mes = mes.replace(/```[\s\S]*?```|``[\s\S]*?``|`[\s\S]*?`|(\".+?\")/gm, function(match, p1) { + if (p1) { + return "" + p1.replace(/\"/g, "") + ""; + } else { + return match; + } + }); mes = converter.makeHtml(mes); //mes = mes.replace(/{.*}/g, ""); mes = mes.replace(/{{(\*?.+?\*?)}}/g, ""); - - mes = mes.replace(/(]*>[\s\S]*?<\/code>)|\"(.+?)\"/g, function (match, code, quote) { - return code ? code : `${quote}`; - }); mes = mes.replace(/\n/g, "
"); mes = mes.trim(); From 9048efdc8b2bd1854ef9f3898f4644a4ffe76f63 Mon Sep 17 00:00:00 2001 From: Halsey1006 Date: Mon, 24 Apr 2023 19:13:42 -0700 Subject: [PATCH 2/4] Added "Send on Enter" power user setting Defaults to on. Intended for use on mobile, so line breaks can be more easily added while typing. --- public/index.html | 6 +++++- public/script.js | 24 +++++++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/public/index.html b/public/index.html index 998100c74..ab6706e01 100644 --- a/public/index.html +++ b/public/index.html @@ -1260,7 +1260,11 @@ Swipes -