From c3ebaabb1aed54ac9227ebaf66c2bf39463819a9 Mon Sep 17 00:00:00 2001 From: ivamp Date: Thu, 26 Sep 2024 23:55:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=89=94=E9=99=A4=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/chat/Chat.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue index 1d57de3..ccc0d9f 100644 --- a/src/components/chat/Chat.vue +++ b/src/components/chat/Chat.vue @@ -368,8 +368,15 @@ function sendText() { return; } + let mdContent = html2markdown(textContent) + // 清除所有的 html 标签,只保留纯文本 + mdContent = mdContent.replace(/<[^>]*>/g, ""); + + // 发送文本到服务器 - sendMessage("user", html2markdown(textContent)); + sendMessage("user", mdContent); + + // 清空输入框 input.innerText = "";