aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-10-08 05:20:12 +0200
committerGitHub <noreply@github.com>2023-10-08 03:20:12 +0000
commit08efeb5cdc22d21b5ef12cc540727594a22062d1 (patch)
treee20d6d239073cacf07c064b6910b4286870d16a1 /web_src/js
parente96e440b8bde5516ffc7bba42691e26084a96588 (diff)
downloadgitea-08efeb5cdc22d21b5ef12cc540727594a22062d1.tar.gz
gitea-08efeb5cdc22d21b5ef12cc540727594a22062d1.zip
Fix mermaid flowchart margin issue (#27503)
Fixes: https://github.com/go-gitea/gitea/issues/27435 Related: https://github.com/mermaid-js/mermaid/issues/4907 <img width="924" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/494a1d2e-4c56-48d0-9843-82a5e5aa977e">
Diffstat (limited to 'web_src/js')
-rw-r--r--web_src/js/markup/mermaid.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/web_src/js/markup/mermaid.js b/web_src/js/markup/mermaid.js
index 865a414c93..84d88a94c3 100644
--- a/web_src/js/markup/mermaid.js
+++ b/web_src/js/markup/mermaid.js
@@ -4,9 +4,11 @@ import {displayError} from './common.js';
const {mermaidMaxSourceCharacters} = window.config;
+// margin removal is for https://github.com/mermaid-js/mermaid/issues/4907
const iframeCss = `:root {color-scheme: normal}
body {margin: 0; padding: 0; overflow: hidden}
-#mermaid {display: block; margin: 0 auto}`;
+#mermaid {display: block; margin: 0 auto}
+blockquote, dd, dl, figure, h1, h2, h3, h4, h5, h6, hr, p, pre {margin: 0}`;
export async function renderMermaid() {
const els = document.querySelectorAll('.markup code.language-mermaid');