fix
This commit is contained in:
parent
184edb8b44
commit
bc4a3bcc77
11
app.js
11
app.js
@ -256,7 +256,8 @@ function onMessageAdded(from, message, avatar) {
|
|||||||
$text.classList.add('message-text');
|
$text.classList.add('message-text');
|
||||||
|
|
||||||
// Render Markdown content
|
// Render Markdown content
|
||||||
const markdownContent = marked(message);
|
const md = window.markdownit();
|
||||||
|
const markdownContent = md.render(message);
|
||||||
$text.innerHTML = markdownContent;
|
$text.innerHTML = markdownContent;
|
||||||
|
|
||||||
$content.appendChild($header);
|
$content.appendChild($header);
|
||||||
@ -265,13 +266,5 @@ function onMessageAdded(from, message, avatar) {
|
|||||||
|
|
||||||
document.querySelector('#messages').appendChild($div);
|
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();
|
initialize();
|
||||||
|
Loading…
Reference in New Issue
Block a user