We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24f3d8c commit 5752f45Copy full SHA for 5752f45
web/llm_chat.js
@@ -537,8 +537,13 @@ class LLMChatInstance {
537
const msgText = msg.getElementsByClassName("msg-text");
538
if (msgText.length != 1) throw Error("Expect msg-text");
539
if (msgText[0].innerHTML == text) return;
540
- text = text.replaceAll("\n", "<br>");
541
- msgText[0].innerHTML = text;
+ const list = text.split('\n').map((t) => {
+ const item = document.createElement('div');
542
+ item.textContent = t;
543
+ return item;
544
+ });
545
+ msgText[0].innerHTML = '';
546
+ list.forEach((item) => msgText[0].append(item));
547
this.uiChat.scrollTo(0, this.uiChat.scrollHeight);
548
}
549
0 commit comments