Skip to content

Commit 4dfe1ff

Browse files
fix: update MermaidBlock styles for improved rendering and add foreignObject (#7960)
fix: update MermaidBlock styles for improved rendering and add foreignObject width Co-authored-by: lixiaoyang1992 <[email protected]>
1 parent 00a24af commit 4dfe1ff

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

gui/src/components/StyledMarkdownPreview/MermaidBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default function MermaidDiagram({ code }: { code: string }) {
141141
{!!error ? (
142142
<div className="text-error whitespace-pre text-sm">{error}</div>
143143
) : (
144-
<div className="relative">
144+
<div className="mermaid relative">
145145
<div className="absolute right-0 z-10 m-2 flex items-center gap-x-1">
146146
<ToolTip content={"Zoom In"}>
147147
<MagnifyingGlassPlusIcon

gui/src/components/StyledMarkdownPreview/markdown.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,3 +1038,6 @@ body[data-color-mode*="light"] {
10381038
.token.entity {
10391039
cursor: help;
10401040
}
1041+
.mermaid foreignObject {
1042+
width: 100%;
1043+
}

0 commit comments

Comments
 (0)