mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-06-21 00:00:35 +00:00
mermaid: assert that window.mermaid is actually mermaid #136
This commit is contained in:
parent
139c587757
commit
f3c067bf9b
2 changed files with 2 additions and 2 deletions
static/js
|
@ -104,7 +104,7 @@ function initMermaid() {
|
|||
$(element).parent().replaceWith('<div class="mermaid" align="center">' + content + '</div>');
|
||||
});
|
||||
|
||||
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({})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue