This commit is contained in:
Raven Scott 2024-06-04 00:38:14 -04:00
parent 184edb8b44
commit bc4a3bcc77

11
app.js
View File

@ -256,7 +256,8 @@ function onMessageAdded(from, message, avatar) {
$text.classList.add('message-text');
// Render Markdown content
const markdownContent = marked(message);
const md = window.markdownit();
const markdownContent = md.render(message);
$text.innerHTML = markdownContent;
$content.appendChild($header);
@ -265,13 +266,5 @@ function onMessageAdded(from, message, avatar) {
document.querySelector('#messages').appendChild($div);
}
async function updateIcon(username, avatarBuffer) {
// Update the icon in the local HTML if necessary
// This can be adjusted as per your needs
const userIcon = document.querySelector(`img[src*="${username}.png"]`);
if (userIcon) {
userIcon.src = URL.createObjectURL(new Blob([avatarBuffer]));
}
}
initialize();