mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-26 11:46:51 +08:00
Fix mermaid-related bugs (#21431)
This commit is contained in:
@ -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');
|
||||
|
Reference in New Issue
Block a user