Spaces:
Running
Running
fix: handle null or undefined content when parsing markdown in bot messages
Browse files- index.html +2 -2
index.html
CHANGED
|
@@ -384,7 +384,7 @@
|
|
| 384 |
contentDiv.className = 'message-content';
|
| 385 |
|
| 386 |
if (role === 'bot') {
|
| 387 |
-
contentDiv.innerHTML = marked.parse(content);
|
| 388 |
} else {
|
| 389 |
contentDiv.textContent = content;
|
| 390 |
}
|
|
@@ -438,7 +438,7 @@
|
|
| 438 |
typingIndicator.style.display = 'none';
|
| 439 |
}
|
| 440 |
fullResponse = event.data[0];
|
| 441 |
-
botContentDiv.innerHTML = marked.parse(fullResponse);
|
| 442 |
scrollToBottom();
|
| 443 |
}
|
| 444 |
if (event.type === "status") {
|
|
|
|
| 384 |
contentDiv.className = 'message-content';
|
| 385 |
|
| 386 |
if (role === 'bot') {
|
| 387 |
+
contentDiv.innerHTML = marked.parse(content || "");
|
| 388 |
} else {
|
| 389 |
contentDiv.textContent = content;
|
| 390 |
}
|
|
|
|
| 438 |
typingIndicator.style.display = 'none';
|
| 439 |
}
|
| 440 |
fullResponse = event.data[0];
|
| 441 |
+
botContentDiv.innerHTML = marked.parse(fullResponse || "");
|
| 442 |
scrollToBottom();
|
| 443 |
}
|
| 444 |
if (event.type === "status") {
|