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:
parent
e8066e29f9
commit
b9ee32e518
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue