diff --git a/components/PrismMac.js b/components/PrismMac.js index 38742281..0a69e55e 100644 --- a/components/PrismMac.js +++ b/components/PrismMac.js @@ -140,8 +140,10 @@ const renderMermaid = async() => { } if (needLoad) { loadExternalResource(BLOG.MERMAID_CDN, 'js').then(url => { - const mermaid = window.mermaid - mermaid.contentLoaded() + setTimeout(() => { + const mermaid = window.mermaid + mermaid?.contentLoaded() + }, 100) }) } }