debug: add code block detection logging, disable hljs temporarily
This commit is contained in:
parent
ff316c7e91
commit
c5faf2beea
@ -452,12 +452,11 @@ const indexHTML = `<!DOCTYPE html>
|
|||||||
agentCallIndicator.classList.remove('active');
|
agentCallIndicator.classList.remove('active');
|
||||||
}
|
}
|
||||||
const content = currentAssistantDiv.querySelector('.message-content');
|
const content = currentAssistantDiv.querySelector('.message-content');
|
||||||
content.innerHTML = renderMarkdown(currentContent);
|
const rendered = renderMarkdown(currentContent);
|
||||||
if (typeof hljs !== 'undefined') {
|
if (currentContent.includes('\u0060\u0060\u0060')) {
|
||||||
content.querySelectorAll('pre code').forEach(function(block) {
|
console.log('Code block detected, rendered:', rendered.substring(0, 500));
|
||||||
hljs.highlightElement(block);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
content.innerHTML = rendered;
|
||||||
chatBox.scrollTop = chatBox.scrollHeight;
|
chatBox.scrollTop = chatBox.scrollHeight;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -500,12 +499,6 @@ const indexHTML = `<!DOCTYPE html>
|
|||||||
chatBox.appendChild(div);
|
chatBox.appendChild(div);
|
||||||
chatBox.scrollTop = chatBox.scrollHeight;
|
chatBox.scrollTop = chatBox.scrollHeight;
|
||||||
|
|
||||||
if (role !== 'user' && typeof hljs !== 'undefined') {
|
|
||||||
text.querySelectorAll('pre code').forEach(function(block) {
|
|
||||||
hljs.highlightElement(block);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return div;
|
return div;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user