Skip to content

Commit 81a19ab

Browse files
fix: don't crash workspace when highlight.js fails to load
1 parent 0ecaf1f commit 81a19ab

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

templates/workspace.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,11 @@ <h2>${escapeHtml(tab.title)}</h2>
296296

297297
main.innerHTML = html;
298298

299-
main.querySelectorAll('pre code').forEach(block => {
300-
hljs.highlightElement(block);
301-
});
299+
if (typeof hljs !== 'undefined') {
300+
main.querySelectorAll('pre code').forEach(block => {
301+
hljs.highlightElement(block);
302+
});
303+
}
302304
}
303305

304306
function renderToolCall(tc) {

0 commit comments

Comments
 (0)