akhaliq HF Staff commited on
Commit
e52ddb2
·
1 Parent(s): bf21d04

fix: handle null or undefined content when parsing markdown in bot messages

Browse files
Files changed (1) hide show
  1. 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") {