fix: apply syntax highlighting to code blocks on page reload

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Russell Ballestrini 2025-07-10 18:17:54 -04:00
parent e8066e29f9
commit b9ee32e518

View file

@ -1484,6 +1484,12 @@ You have complete knowledge of this page content and can reference any details,
const aiMsg = document.createElement("div");
aiMsg.className = "ai-message";
aiMsg.innerHTML = marked.parse(msg.content);
// Add syntax highlighting to all code blocks
aiMsg.querySelectorAll("pre code").forEach((block) => {
hljs.highlightElement(block);
});
addCodeBlockCopyButtons(aiMsg);
// Add TTS and delete buttons to historical AI messages