feat: 完善 Mermaid 配置与预览缩放

This commit is contained in:
SkyJourney
2026-07-26 23:10:22 +08:00
parent 15dd2acfc0
commit d93728bb8b
25 changed files with 870 additions and 56 deletions
@@ -95,21 +95,34 @@ flowchart LR
---
title: Frontmatter 示例
config:
layout: elk
theme: forest
look: handDrawn
fontFamily: Microsoft YaHei
themeVariables:
primaryColor: "#dbeafe"
flowchart:
curve: basis
---
flowchart LR
classDef important fill:#fee2e2,stroke:#dc2626
A[开始] --> B[结束]
style A fill:#dcfce7,stroke:#16a34a
class B important
\`\`\`
`);
expect(result.bodyHtml).toContain("title: Frontmatter 示例");
expect(result.bodyHtml).toContain("layout: elk");
expect(result.bodyHtml).toContain("theme: forest");
expect(result.bodyHtml).toContain("look: handDrawn");
expect(result.bodyHtml).toContain("fontFamily: Microsoft YaHei");
expect(result.bodyHtml).toContain("primaryColor:");
expect(result.bodyHtml).toContain("curve: basis");
expect(result.bodyHtml).toContain("flowchart LR");
expect(result.bodyHtml).toContain("classDef important");
expect(result.bodyHtml).toContain("style A fill:");
expect(result.bodyHtml).toContain("class B important");
});
it("阻止原始 HTML 和危险链接形成可执行内容", () => {