From: Alexander Wilms Date: Thu, 26 Jun 2025 22:23:35 +0000 (+0200) Subject: refactor(mermaid-viewer): Simplify mermaid viewer initialization X-Git-Url: http://source.bookstackapp.com/hacks/commitdiff_plain/be8cecc3eff035b08d0cf77ade0dbb13d0b285f4 refactor(mermaid-viewer): Simplify mermaid viewer initialization Removes unnecessary comment about CMS wrapping and dynamic content handling. --- diff --git a/content/mermaid-viewer/head.html b/content/mermaid-viewer/head.html index 187b410..8e7afe0 100644 --- a/content/mermaid-viewer/head.html +++ b/content/mermaid-viewer/head.html @@ -408,7 +408,6 @@ const mermaidViewers = []; function initializeMermaidViewers() { - // Adjust the selector if your CMS wraps mermaid code blocks differently const codeBlocks = document.querySelectorAll('pre code.language-mermaid'); for (const codeBlock of codeBlocks) { // Ensure we don't re-initialize if this script runs multiple times or content is dynamic @@ -448,10 +447,6 @@ }); }); - // Optional: If your CMS dynamically adds content, you might need a way to re-run initialization - // For example, using a MutationObserver or a custom event. - // document.addEventListener('myCMSContentLoaded', () => initializeMermaidViewers()); -