-
+ const formattedContent = formatMessage(msg.content, isUser);
+ const messageDiv = document.createElement('div');
+ messageDiv.className = `flex gap-4 ${isUser ? 'flex-row-reverse' : 'flex-row'} message-animation`;
+ messageDiv.innerHTML = `
+
+
+
+
`;
- container.insertAdjacentHTML('beforeend', messageHtml);
+ container.appendChild(messageDiv);
});
+
+ // Apply syntax highlighting to code blocks
+ document.querySelectorAll('pre code').forEach((block) => {
+ hljs.highlightElement(block);
+ });
+
initIcons();
scrollToBottom();
}