feat: 完善 Mermaid 配置与预览缩放
This commit is contained in:
@@ -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 和危险链接形成可执行内容", () => {
|
||||
|
||||
Reference in New Issue
Block a user