Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Web: update Mermaid to 12.1.0 while preserving the existing layout and appearance of published diagrams.

- Use one shared autoreview installation from `openclaw/agent-skills`; repository entrypoints now receive upstream fixes without copied helpers or test suites.

## 0.24.0 - 2026-09-30
Expand Down
20 changes: 16 additions & 4 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"ignore": "7.0.6",
"jose": "6.2.9",
"lucide-react": "1.31.0",
"mermaid": "^11.16.1",
"mermaid": "12.1.0",
"mime": "4.1.0",
"monaco-editor": "0.56.0",
"parse5": "8.0.1",
Expand Down
13 changes: 12 additions & 1 deletion src/components/MarkdownPreview.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,22 @@ describe("MarkdownPreview — standard markdown still renders", () => {
expect(code?.textContent).toContain("const x = 1;");
});

it("renders mermaid fenced code blocks as diagrams instead of plain code", () => {
it("keeps published Mermaid diagrams on their existing layout and look", async () => {
const container = renderMarkdown("```mermaid\ngraph TD\n A --> B\n```");

expect(container.querySelector("[data-mermaid-diagram]")).not.toBeNull();
expect(container.querySelector("pre code.language-mermaid")).toBeNull();

const { default: mermaid } = await import("mermaid");
await waitFor(() => {
expect(mermaid.mermaidAPI.getConfig()).toMatchObject({
theme: "neutral",
layout: "dagre",
look: "classic",
securityLevel: "strict",
startOnLoad: false,
});
});
});

it("cleans up temporary Mermaid nodes when rendering falls back", async () => {
Expand Down
3 changes: 3 additions & 0 deletions src/components/MarkdownPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ function loadMermaid(): Promise<MermaidApi> {
startOnLoad: false,
securityLevel: "strict",
theme: "neutral",
// Published diagrams keep their appearance when Mermaid changes its defaults.
layout: "dagre",
look: "classic",
});
return mermaid;
});
Expand Down
Loading