Skip to content

Commit 3a30558

Browse files
committed
Handle errors when loading katex
For microsoft#260913
1 parent 3c25740 commit 3a30558

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,15 @@ export class ChatMarkdownContentPart extends Disposable implements IChatContentP
280280

281281
if (enableMath && !MarkedKatexSupport.getExtension(dom.getWindow(context.container))) {
282282
// Need to load async
283-
MarkedKatexSupport.loadExtension(dom.getWindow(context.container)).then(() => {
284-
doRenderMarkdown();
285-
if (!this._isDisposed) {
286-
this._onDidChangeHeight.fire();
287-
}
288-
});
283+
MarkedKatexSupport.loadExtension(dom.getWindow(context.container))
284+
.catch(e => {
285+
console.error('Failed to load MarkedKatexSupport extension:', e);
286+
}).finally(() => {
287+
doRenderMarkdown();
288+
if (!this._isDisposed) {
289+
this._onDidChangeHeight.fire();
290+
}
291+
});
289292
} else {
290293
doRenderMarkdown();
291294
}

0 commit comments

Comments
 (0)