fix: add missing initMermaid() call + skip mermaid blocks in highlight.js
This commit is contained in:
@@ -16,6 +16,7 @@ import * as Legacy from './legacy.js';
|
|||||||
import { initCommandPalette } from './palette.js';
|
import { initCommandPalette } from './palette.js';
|
||||||
import { initMobileToolbar } from './mobile-toolbar.js';
|
import { initMobileToolbar } from './mobile-toolbar.js';
|
||||||
import { initDragDrop } from './dragdrop.js';
|
import { initDragDrop } from './dragdrop.js';
|
||||||
|
import { initMermaid, setupFocusMode } from './mermaid-viewer.js';
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// Initialization — mirrors the original app.js init() ordering
|
// Initialization — mirrors the original app.js init() ordering
|
||||||
@@ -85,6 +86,8 @@ async function init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initGraphView();
|
initGraphView();
|
||||||
|
initMermaid();
|
||||||
|
setupFocusMode();
|
||||||
Utils.safeCreateIcons();
|
Utils.safeCreateIcons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -248,6 +248,8 @@ function flushIcons() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function safeHighlight(block) {
|
function safeHighlight(block) {
|
||||||
|
// Skip mermaid blocks — they're rendered by Mermaid.js, not highlighted
|
||||||
|
if (block.className && block.className.indexOf('language-mermaid') !== -1) return;
|
||||||
if (typeof hljs !== "undefined" && hljs.highlightElement) {
|
if (typeof hljs !== "undefined" && hljs.highlightElement) {
|
||||||
try {
|
try {
|
||||||
hljs.highlightElement(block);
|
hljs.highlightElement(block);
|
||||||
|
|||||||
Reference in New Issue
Block a user