diff --git a/src/uncloseai-embed-modal.js b/src/uncloseai-embed-modal.js index 28269df..ad930f6 100644 --- a/src/uncloseai-embed-modal.js +++ b/src/uncloseai-embed-modal.js @@ -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