AKS1st/dsh-mermaid

AKS1st★ 2TypeScript最后同步: 2026-08-15

在 GitHub 打开

在 DSH Web 会话中把 Mermaid 代码围栏渲染为 SVG 图表 | Render Mermaid code fences as SVG diagrams in DSH Web messages

README 摘要

dsh-mermaid 在 DSH Web 会话消息中把 sh dsh plugin --profile web add github:AKS1st/dsh-mermaid dsh web 重启 web 服务使 profile 生效 sh npm install npm run build dsh plugin --profile web add . dsh web sh dsh plugin --profile web remove @dsh-external/dsh-mermaid yaml - insert: - id: mermaid name: '@dsh-external/dsh-mermaid' config: theme: auto maxTextSize: 50000 maxEdges: 2000 securityLevel: strict 配置项 默认值 说明 : theme auto 图表主题: auto (跟随亮/暗)、 default 、 dark 、 neutral 、 forest 、 base maxTextSize 50000 单图文本上限(防超大图拖垮渲染) maxEdges 2000 边数守卫 securityLevel strict 固定为 strict ,不接受 loose 在 profile 的 cordis.patch.yml 里以 - set: 或 - update: 覆盖即可。 安全模型 - 助手输出不可信: securityLevel 锁定 strict ,标签中的 HTML 由 mermaid 内部 DOMPurify 消毒;不调用 bindFunctions ,点击处理保持惰性。 - 渲染失败时保留原纯文本代码块(绝不渲染错误 HTML),控制台可见错误。 已知限制 - 依赖主前端 CodeBlock 的稳定钩子(字面量类 md-code-block 与 infostring 文本);上游渲染器重构时需要同步更新选择器。 - 流式输出期间不渲染,定格后才渲染。 - securityLevel: strict 下 mermaid 的点击交互不可用。

在 GitHub 查看完整 README →
工具/开发cordisdeepseek-harnessdiagramdshdsh-pluginmarkdownmermaidplugin

分类