]> BookStack Code Mirror - hacks/commitdiff
refactor(mermaid-viewer): Simplify mermaid viewer initialization
authorAlexander Wilms <redacted>
Thu, 26 Jun 2025 22:23:35 +0000 (00:23 +0200)
committerAlexander Wilms <redacted>
Thu, 26 Jun 2025 22:23:35 +0000 (00:23 +0200)
Removes unnecessary comment about CMS wrapping and dynamic content handling.

content/mermaid-viewer/head.html

index 187b41098d03e164ba9e9946c8aba7c6d732a861..8e7afe08d6d92f1f29718084dc3dba816b62d14a 100644 (file)
 
     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
         });
     });
 
-    // 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());
-
 </script>
 <style>
     /* Use BookStack's CSS variables for seamless theme integration */