perf: 优化消息&符号

This commit is contained in:
kuaifan 2022-12-02 13:36:40 +08:00
parent 3a3ecd920f
commit 9cf3503a84
2 changed files with 2 additions and 0 deletions

View File

@ -542,6 +542,7 @@ class WebSocketDialogMsg extends AbstractModel
if (!$preserveHtml) {
$text = strip_tags($text);
$text = str_replace(" ", " ", $text);
$text = str_replace("&", "&", $text);
}
return $text;
}

View File

@ -376,6 +376,7 @@
text = text.replace(/<img\s+class="emoticon"[^>]*?>/g, `[${$A.L('动画表情')}]`)
text = text.replace(/<img\s+class="browse"[^>]*?>/g, `[${$A.L('图片')}]`)
text = text.replace(/&nbsp;/g," ")
text = text.replace(/&amp;/g,"&")
return text.replace(/<[^>]+>/g,"")
},