Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: modernize javascript and remove div #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TendTo
Copy link

@TendTo TendTo commented Apr 4, 2023

First of all, I'm really grateful for the script you provided. I tried to achieve something similar on my own but I always ran into some issues with errors and strange rendering sizes. This script works like a charm.

Just for the sake of it, I tried to modernize it a bit, using arrow functions and string interpolation.

Also, I noticed you created an additional div containing the div with the mermaid svg. I think it is safe to remove the external div.

<!-- Current structure -->
<div>
  <div class="mermaid" data-processed="true">
    <svg>
        <!-- graph -->
    </svg>
  <div>
<div>
<!-- New structure -->
<div class="mermaid" data-processed="true">
  <svg>
      <!-- graph -->
  </svg>
<div>

Let me know what do you think, if you have any suggestion or if you prefer things as they are now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant