Fixed Mermaid not mounted when headline with same name is present

This commit is contained in:
squidfunk
2022-03-02 16:06:21 +01:00
parent 1bdf22f3f3
commit cfa64745a2
4 changed files with 6 additions and 6 deletions

View File

@@ -68,7 +68,7 @@ let index = 0
* @returns Mermaid scripts observable
*/
function fetchScripts(): Observable<void> {
return typeof mermaid === "undefined"
return typeof mermaid === "undefined" || mermaid instanceof Element
? watchScript("https://unpkg.com/mermaid@8.13.3/dist/mermaid.min.js")
: of(undefined)
}