@helping-ai-workflow/md2doc 2.1.0 → 2.1.1

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/lib/md2doc.js +6 -2
  2. package/package.json +1 -1
package/lib/md2doc.js CHANGED
@@ -88,7 +88,7 @@ const waveDromTag = inlineScriptTag(localWaveDromJs)
88
88
 
89
89
  const mermaidScriptTag = inlineScriptTag(localMermaidJs)
90
90
  || `<script type="module">
91
- import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
91
+ import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
92
92
  mermaid.initialize({ startOnLoad: true, theme: 'default' });
93
93
  </script>`;
94
94
 
@@ -309,7 +309,11 @@ ${itemsHtml}
309
309
  return `\n<script type="WaveDrom">\n${code}\n</script>\n`;
310
310
  }
311
311
  if (lang === 'mermaid') {
312
- return `\n<div class="mermaid">\n${code}\n</div>\n`;
312
+ // Escape so the browser delivers the literal source to mermaid. Raw
313
+ // injection lets the HTML parser consume entities and tags first —
314
+ // an author's &lt;IP&gt; became an <IP> element mermaid sanitized
315
+ // away — diverging from GitHub's escaped-code-block semantics.
316
+ return `\n<div class="mermaid">\n${escapeHtml(code)}\n</div>\n`;
313
317
  }
314
318
  if (lang === 'dot' || lang === 'graphviz') {
315
319
  const r = spawnSync('dot', ['-Tsvg'], { input: code, encoding: 'utf8', timeout: 10000 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helping-ai-workflow/md2doc",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Markdown → HTML / PDF renderer with WaveDrom, Mermaid, and Graphviz support",
5
5
  "keywords": [
6
6
  "markdown",