diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 047afe0d55..b477563650 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -42,7 +42,7 @@ {{- $.Scratch.Set "mermaidInitialize" "{ \"startOnLoad\": true }" }} {{- end }} diff --git a/static/js/relearn.js b/static/js/relearn.js index 599c0e6b44..b229375315 100644 --- a/static/js/relearn.js +++ b/static/js/relearn.js @@ -104,7 +104,7 @@ function initMermaid() { $(element).parent().replaceWith('
' + content + '
'); }); - if (typeof mermaid != 'undefined') { + if (typeof mermaid != 'undefined' && typeof mermaid.mermaidAPI != 'undefined') { mermaid.mermaidAPI.initialize( Object.assign( {}, mermaid.mermaidAPI.getSiteConfig(), { startOnLoad: true } ) ); mermaid.contentLoaded(); $(".mermaid svg").svgPanZoom({})