@limcpf/everything-is-a-markdown 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/runtime/app.js +16 -8
package/package.json
CHANGED
package/src/runtime/app.js
CHANGED
|
@@ -226,15 +226,23 @@ async function renderMermaidBlocks(config) {
|
|
|
226
226
|
}
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
229
|
+
|
|
230
|
+
for (const block of blocks) {
|
|
231
|
+
try {
|
|
232
|
+
if (typeof mermaid.run === "function") {
|
|
233
|
+
await mermaid.run({ nodes: [block] });
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
if (typeof mermaid.init === "function") {
|
|
237
|
+
await mermaid.init({ startOnLoad: false }, [block]);
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
throw new Error("Mermaid 렌더러 API가 존재하지 않습니다.");
|
|
241
|
+
} catch (error) {
|
|
242
|
+
const message = `Mermaid 렌더링 실패: ${error instanceof Error ? error.message : String(error)}`;
|
|
243
|
+
showMermaidError(block, message);
|
|
244
|
+
}
|
|
236
245
|
}
|
|
237
|
-
throw new Error("Mermaid 렌더러 API가 존재하지 않습니다.");
|
|
238
246
|
} catch (error) {
|
|
239
247
|
const message = `Mermaid 렌더링 실패: ${error instanceof Error ? error.message : String(error)}`;
|
|
240
248
|
for (const block of blocks) {
|