mermaid-js / mermaid-live-editor

Edit, preview and share mermaid charts/diagrams. New implementation of the live editor.
https://mermaid.live
MIT License
4.13k stars 626 forks source link

fix: fixes proper loading of embedded images in downloaded PNG files #1488

Closed majid-2002 closed 2 months ago

majid-2002 commented 2 months ago

:bookmark_tabs: Summary

This PR addresses the issue of image loading for generated PNG files. It resolves the problem where images were not being correctly downloaded due to timing issues but does not resolve the issue of missing font awesome icons in the PNG files. This issue is tracked under #681.

Brief description about the content of your PR: Adjusted the logic to ensure that images are fully loaded before being downloaded.

Resolves # It doesn't resolve the fa icons loading issue. But it resolves the loading issues of images in PNG image downloaded in the action tab. This issue wasn't raised previously but was identified and resolved.

:straight_ruler: Design Decisions

Describe the way your implementation works or what design decisions you made if applicable:

Modified the handling of image downloads to fix issues related to image loading and ensure that downloaded images are complete.

previous behavior in png files downloaded: mermaid-diagram-2024-07-20-135734

fixed behavior: mermaid-diagram-2024-07-20-135935

:clipboard: Tasks

Make sure you

netlify[bot] commented 2 months ago

Deploy Preview for mermaidjs ready!

Name Link
Latest commit 4d7513c7d9356a9b4460fd94b3f25f6e7959d454
Latest deploy log https://app.netlify.com/sites/mermaidjs/deploys/669b7713f3b5d80008bf2066
Deploy Preview https://deploy-preview-1488--mermaidjs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

sidharthv96 commented 2 months ago

FA icons doesn't seem to appear on the downloaded PNGs.

mermaid-diagram-2024-07-21-132450

Live editor