Skip to content

Commit 1d4c193

Browse files
authored
Fix mermaid flowchart margin issue (#27503) (#27517)
Backport #27503 to 1.20 Fixes: #27435 Related: mermaid-js/mermaid#4907 <img width="924" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/494a1d2e-4c56-48d0-9843-82a5e5aa977e">
1 parent 4ffa683 commit 1d4c193

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

web_src/js/markup/mermaid.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import {displayError} from './common.js';
44

55
const {mermaidMaxSourceCharacters} = window.config;
66

7+
// margin removal is for https://github.com/mermaid-js/mermaid/issues/4907
78
const iframeCss = `:root {color-scheme: normal}
89
body {margin: 0; padding: 0; overflow: hidden}
9-
#mermaid {display: block; margin: 0 auto}`;
10+
#mermaid {display: block; margin: 0 auto}
11+
blockquote, dd, dl, figure, h1, h2, h3, h4, h5, h6, hr, p, pre {margin: 0}`;
1012

1113
export async function renderMermaid() {
1214
const els = document.querySelectorAll('.markup code.language-mermaid');

0 commit comments

Comments
 (0)