Update static/script.js
Browse files- static/script.js +2 -1
static/script.js
CHANGED
@@ -136,11 +136,12 @@ const chatContainer = document.getElementById("chatContainer");
|
|
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.
|
140 |
chatContainer.appendChild(div);
|
141 |
chatContainer.scrollTop = chatContainer.scrollHeight;
|
142 |
}
|
143 |
|
|
|
144 |
chatForm.addEventListener("submit", async (e) => {
|
145 |
e.preventDefault();
|
146 |
const prompt = userInput.value.trim();
|
|
|
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();
|