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

@ -214,7 +214,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.5413a266.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.144dcfcd.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}

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)
}