@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/runtime/app.js +16 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limcpf/everything-is-a-markdown",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "type": "module",
@@ -226,15 +226,23 @@ async function renderMermaidBlocks(config) {
226
226
  }
227
227
  return;
228
228
  }
229
- if (typeof mermaid.run === "function") {
230
- await mermaid.run({ nodes: blocks });
231
- return;
232
- }
233
- if (typeof mermaid.init === "function") {
234
- await mermaid.init({ startOnLoad: false }, blocks);
235
- return;
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) {