memorax-ai/dsh-render-engine--packages-mermaid-render ↗★ 1

@ch4acko3/dsh-mermaid-render

将Mermaid定义安全渲染为SVG图表 适合需要在Web插件中动态生成和展示流程图、时序图等图表的开发者。

包名
@ch4acko3/dsh-mermaid-render
兼容性
待验证
Cordis 依赖范围
^4.0.1
版本
0.1.2
许可证
MIT
最近更新
2026年9月24日

同名包的其他仓库

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:memorax-ai/dsh-render-engine#9582bf138d3a6d7381a84359a4a0b878a1ea8952&path:packages/mermaid-render

@ch4acko3/dsh-mermaid-render

A browser-side Cordis service that renders untrusted Mermaid definitions as sanitized SVG diagrams.

export const inject = ['mermaidRenderer']

export async function apply(ctx) {
  const result = await ctx.mermaidRenderer.render({
    source: 'graph TD\n  Parse --> Render',
  })
  console.log(result.html)
}

Mermaid runs with securityLevel: 'strict'; the generated SVG is sanitized again before it is returned. The service provides rendering only and does not ship a ChatView card or diagram editor.