mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 05:12:49 +00:00
perf: 优化预览消息
This commit is contained in:
parent
6ed0e14fe0
commit
a95504bbf1
@ -633,6 +633,7 @@ class WebSocketDialogMsg extends AbstractModel
|
||||
$text = preg_replace("/<img\s+class=\"emoticon\"[^>]*?>/", "[动画表情]", $text);
|
||||
$text = preg_replace("/<img\s+class=\"browse\"[^>]*?>/", "[图片]", $text);
|
||||
if (!$preserveHtml) {
|
||||
$text = str_replace("</p><p>", "</p> <p>", $text);
|
||||
$text = strip_tags($text);
|
||||
$text = str_replace([" ", "&", "<", ">"], [" ", "&", "<", ">"], $text);
|
||||
$text = preg_replace("/\s+/", " ", $text);
|
||||
|
||||
1
resources/assets/js/functions/web.js
vendored
1
resources/assets/js/functions/web.js
vendored
@ -270,6 +270,7 @@ import {MarkdownPreview} from "../store/markdown";
|
||||
text = text.replace(/<img\s+class="browse"[^>]*?>/g, `[${$A.L('图片')}]`)
|
||||
}
|
||||
text = text
|
||||
.replace(/<\/p><p>/g, "</p> <p>")
|
||||
.replace(/<[^>]+>/g, "")
|
||||
.replace(/ /g, " ")
|
||||
.replace(/"/g, "\"")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user