From 9aebabf698d031a15c0c92ddbc4d6d064f4ebdc3 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Mon, 17 Apr 2023 17:19:44 +0300 Subject: [PATCH] Parse images sent by oobabooga plugin --- public/script.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/script.js b/public/script.js index 0266831a8..a8937495a 100644 --- a/public/script.js +++ b/public/script.js @@ -869,6 +869,9 @@ function messageFormating(mes, ch_name, isSystem, forceAvatar) { .replace(/\*\*(.+?)\*\*/g, "$1") .replace(/\n/g, "
"); } else if (!isSystem) { + const image = /<img src="(.*?)".*?alt="(.*?)".*?>/g; + mes = mes.replace(image, '![$2]($1)'); + mes = converter.makeHtml(mes); //mes = mes.replace(/{.*}/g, ""); mes = mes.replace(/{{(\*?.+?\*?)}}/g, "");