You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ifis_mermaid:
new_lines.append('')
# This will initialize mermaid renderer. It's done only when the HTML document is ready,# to ensure the loading of mermaid.js file is finished.new_lines.append('''<script> function initializeMermaid() { mermaid.initialize({startOnLoad:true}) } if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(initializeMermaid, 1); } else { document.addEventListener("DOMContentLoaded", initializeMermaid); } </script>''')
In my opinion, this is the best option. If you want, I make a pull request.
3.2. Option
If you don’t want to delete the code above completely, it would be nice to have an option to not add a script. For example, if:
md_mermaid:
add_initialize_script: false
md_mermaid won’t add the script.
Thanks.
The text was updated successfully, but these errors were encountered:
1. Summary
It would be nice, if would be possible to not add automatically a Mermaid initialize script to the HTML.
2. Argumentation
<script>
tag at the bottom of<body>
is old approach. Modern solution — adding it inside<head>
tag.3. Examples of expected behavior
3.1. Fully disable auto-adding of initialize script
In my fork I remove these lines from
md_mermaid.py
:In my opinion, this is the best option. If you want, I make a pull request.
3.2. Option
If you don’t want to delete the code above completely, it would be nice to have an option to not add a script. For example, if:
md_mermaid won’t add the script.
Thanks.
The text was updated successfully, but these errors were encountered: