From c5faf2beead542f0ef3c910103b3d7ffffe5eda1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=A3=AE?= Date: Sun, 10 May 2026 16:13:11 +0800 Subject: [PATCH] debug: add code block detection logging, disable hljs temporarily --- internal/web/html.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/internal/web/html.go b/internal/web/html.go index 921e6f7..7281490 100644 --- a/internal/web/html.go +++ b/internal/web/html.go @@ -452,12 +452,11 @@ const indexHTML = ` agentCallIndicator.classList.remove('active'); } const content = currentAssistantDiv.querySelector('.message-content'); - content.innerHTML = renderMarkdown(currentContent); - if (typeof hljs !== 'undefined') { - content.querySelectorAll('pre code').forEach(function(block) { - hljs.highlightElement(block); - }); + const rendered = renderMarkdown(currentContent); + if (currentContent.includes('\u0060\u0060\u0060')) { + console.log('Code block detected, rendered:', rendered.substring(0, 500)); } + content.innerHTML = rendered; chatBox.scrollTop = chatBox.scrollHeight; } }; @@ -500,12 +499,6 @@ const indexHTML = ` chatBox.appendChild(div); chatBox.scrollTop = chatBox.scrollHeight; - if (role !== 'user' && typeof hljs !== 'undefined') { - text.querySelectorAll('pre code').forEach(function(block) { - hljs.highlightElement(block); - }); - } - return div; }