Fix markdown views loading and theming

This commit is contained in:
thePR0M3TH3AN committed 2025-10-17 11:00:42 -04:00
1 parent a477b63a38
commit f087076401
8 files changed
+157 -32

No files matched your search

+18 -5
View File
@@ -43,12 +43,25 @@
const container = document.getElementById("markdown-container");
if (container) {
container.innerHTML = html;
}
// Optional: highlight code blocks if highlight.js is loaded globally
document.querySelectorAll("pre code").forEach((block) => {
hljs.highlightBlock(block);
});
const highlighter = window.hljs;
const highlight =
highlighter && typeof highlighter.highlightElement === "function"
? (block) => highlighter.highlightElement(block)
: highlighter && typeof highlighter.highlightBlock === "function"
? (block) => highlighter.highlightBlock(block)
: null;
if (highlight) {
container.querySelectorAll("pre code").forEach((block) => {
try {
highlight(block);
} catch (highlightError) {
dev.warn("Failed to highlight code block.", highlightError);
}
});
}
}
} catch (err) {
user.error("Error loading 'Getting Started' content:", err);
const container = document.getElementById("markdown-container");