perf: 去除通知里的 

This commit is contained in:
kuaifan 2022-07-10 21:16:46 +08:00
parent d0d6965c52
commit 4561efc3ce
2 changed files with 5 additions and 4 deletions

View File

@ -502,11 +502,11 @@ class WebSocketDialogMsg extends AbstractModel
$text = preg_replace("/<img\s+class=\"emoticon\"[^>]*?alt=\"(\S+)\"[^>]*?>/", "[$1]", $text); $text = preg_replace("/<img\s+class=\"emoticon\"[^>]*?alt=\"(\S+)\"[^>]*?>/", "[$1]", $text);
$text = preg_replace("/<img\s+class=\"emoticon\"[^>]*?>/", "[表情]", $text); $text = preg_replace("/<img\s+class=\"emoticon\"[^>]*?>/", "[表情]", $text);
$text = preg_replace("/<img\s+class=\"browse\"[^>]*?>/", "[图片]", $text); $text = preg_replace("/<img\s+class=\"browse\"[^>]*?>/", "[图片]", $text);
if ($preserveHtml) { if (!$preserveHtml) {
return $text; $text = strip_tags($text);
} else { $text = str_replace("&nbsp;", " ", $text);
return strip_tags($text);
} }
return $text;
} }
/** /**

View File

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