diff options
author | silverwind <me@silverwind.io> | 2022-10-16 00:04:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-15 18:04:00 -0400 |
commit | 32159cc4a39f8514c91c4bf0896efb94d35d0915 (patch) | |
tree | 23cea585a0555efc1f4e96a5fb91ce274b9cee44 /web_src/js/markup/mermaid.js | |
parent | 8e8b536c293a44c5b3c9f7f504be3327012f1434 (diff) | |
download | gitea-32159cc4a39f8514c91c4bf0896efb94d35d0915.tar.gz gitea-32159cc4a39f8514c91c4bf0896efb94d35d0915.zip |
Fix mermaid-related bugs (#21431)
Diffstat (limited to 'web_src/js/markup/mermaid.js')
-rw-r--r-- | web_src/js/markup/mermaid.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/web_src/js/markup/mermaid.js b/web_src/js/markup/mermaid.js index 773c46e791..62de9a3aae 100644 --- a/web_src/js/markup/mermaid.js +++ b/web_src/js/markup/mermaid.js @@ -50,7 +50,7 @@ export async function renderMermaid() { // can't use bindFunctions here because we can't cross the iframe boundary. This // means js-based interactions won't work but they aren't intended to work either mermaid.mermaidAPI.render('mermaid', source, (svgStr) => { - const heightStr = (svgStr.match(/height="(.+?)"/) || [])[1]; + const heightStr = (svgStr.match(/viewBox="(.+?)"/) || ['', ''])[1].split(/\s+/)[3]; if (!heightStr) return displayError(el, new Error('Could not determine chart height')); const iframe = document.createElement('iframe'); iframe.classList.add('markup-render'); |