UntilDot commited on
Commit
f0f0c40
·
verified ·
1 Parent(s): 08e28d5

Update static/script.js

Browse files
Files changed (1) hide show
  1. static/script.js +3 -2
static/script.js CHANGED
@@ -135,13 +135,14 @@ const chatContainer = document.getElementById("chatContainer");
135
 
136
  function appendMessage(role, text) {
137
  const div = document.createElement("div");
138
- div.className = `p-3 rounded shadow max-w-2xl ${role === "user" ? "bg-blue text-fg0 self-end" : "bg-green text-fg0 self-start"}`;
 
 
139
  div.textContent = text;
140
  chatContainer.appendChild(div);
141
  chatContainer.scrollTop = chatContainer.scrollHeight;
142
  }
143
 
144
-
145
  chatForm.addEventListener("submit", async (e) => {
146
  e.preventDefault();
147
  const prompt = userInput.value.trim();
 
135
 
136
  function appendMessage(role, text) {
137
  const div = document.createElement("div");
138
+ div.className = `p-3 rounded shadow max-w-2xl whitespace-pre-wrap break-words ${
139
+ role === "user" ? "bg-blue text-fg0 self-end" : "bg-green text-fg0 self-start"
140
+ }`;
141
  div.textContent = text;
142
  chatContainer.appendChild(div);
143
  chatContainer.scrollTop = chatContainer.scrollHeight;
144
  }
145
 
 
146
  chatForm.addEventListener("submit", async (e) => {
147
  e.preventDefault();
148
  const prompt = userInput.value.trim();