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, "\"")