From 77ef0fde0a8218cc786ad0db73c276217a4efb43 Mon Sep 17 00:00:00 2001
From: shaoyongjun <mylomen.shao@freebrio.com>
Date: Thu, 16 May 2024 19:55:15 +0800
Subject: [PATCH] to:sync

---
 static/ai-chat.html | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/static/ai-chat.html b/static/ai-chat.html
index dbde194..f860326 100644
--- a/static/ai-chat.html
+++ b/static/ai-chat.html
@@ -27,6 +27,7 @@
             overflow-y: scroll;
             border-bottom: 1px solid #ccc;
             padding-bottom: 10px;
+            white-space: pre-line;
         }
 
         #user-input {
@@ -56,6 +57,10 @@
             color: #000;
         }
 
+        .gpt span{
+            white-space: pre-line;
+        }
+
         .sender {
             font-weight: bold;
         }
@@ -131,7 +136,7 @@
             // body
             body,
             // 收到事件时的回调。这里将事件的data显示在htmlSpanElement中
-            (event) => {const content = getContent(event.data); if (content) htmlSpanElement.innerHTML += content},
+            (event) => {const content = getContent(event.data); if (content) htmlSpanElement.innerHTML += content.toString()},
             // 结束时的回调。1.将消息添加到历史消息中 2.将等待状态设置为false
             () => {addMessage("assistant", htmlSpanElement.innerHTML); waiting = false},
             // 发生错误时的回调