From a95504bbf16c545e3c8114ec0d95b0130c1a8900 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sun, 3 Nov 2024 08:23:41 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/WebSocketDialogMsg.php | 1 + resources/assets/js/functions/web.js | 1 + 2 files changed, 2 insertions(+) diff --git a/app/Models/WebSocketDialogMsg.php b/app/Models/WebSocketDialogMsg.php index 31be91fcb..47a50c5c4 100644 --- a/app/Models/WebSocketDialogMsg.php +++ b/app/Models/WebSocketDialogMsg.php @@ -633,6 +633,7 @@ class WebSocketDialogMsg extends AbstractModel $text = preg_replace("/]*?>/", "[动画表情]", $text); $text = preg_replace("/]*?>/", "[图片]", $text); if (!$preserveHtml) { + $text = str_replace("

", "

", $text); $text = strip_tags($text); $text = str_replace([" ", "&", "<", ">"], [" ", "&", "<", ">"], $text); $text = preg_replace("/\s+/", " ", $text); diff --git a/resources/assets/js/functions/web.js b/resources/assets/js/functions/web.js index 746ec40fd..731ce1ebb 100755 --- a/resources/assets/js/functions/web.js +++ b/resources/assets/js/functions/web.js @@ -270,6 +270,7 @@ import {MarkdownPreview} from "../store/markdown"; text = text.replace(/]*?>/g, `[${$A.L('图片')}]`) } text = text + .replace(/<\/p>

/g, "

") .replace(/<[^>]+>/g, "") .replace(/ /g, " ") .replace(/"/g, "\"")