fix(ui): retry deferred markdown renderer setup

This commit is contained in:
Pascal André
2026-03-17 04:19:02 +01:00
committed by Shantur Rathore
parent de66b1349a
commit 5f144ca24d
2 changed files with 8 additions and 2 deletions

View File

@@ -13,7 +13,10 @@ let markdownModulePromise: Promise<MarkdownModule> | null = null
function loadMarkdownModule(): Promise<MarkdownModule> { function loadMarkdownModule(): Promise<MarkdownModule> {
if (!markdownModulePromise) { if (!markdownModulePromise) {
markdownModulePromise = import("../lib/markdown") markdownModulePromise = import("../lib/markdown").catch((error) => {
markdownModulePromise = null
throw error
})
} }
return markdownModulePromise return markdownModulePromise
} }

View File

@@ -61,7 +61,10 @@ async function getOrCreateHighlighter() {
themes: ["github-light", "github-light-high-contrast", "github-dark"], themes: ["github-light", "github-light-high-contrast", "github-dark"],
langs: [], langs: [],
}) })
})() })().catch((error) => {
highlighterPromise = null
throw error
})
highlighter = await highlighterPromise highlighter = await highlighterPromise
highlighterPromise = null highlighterPromise = null