[BUG] "View full diagram" is not linkable
Bug Report
Describe the bug
On the Open Payments flow documentation, the "View full diagram" links are not able to be copied/pasted. The blob: URLs show in the browser address bar cannot be re-requested. Removing the blob protocol results in a 404 error.
To Reproduce
- Go to Open Payments flow documentation
- Click on "View full diagram"
- Copy URL from browser address bar.
- Paste URL in a private window.
- See browser error.
- Remove
blob:prefix from URL, hit return. - See 404 error.
Screenshots
First click on "View full diagram"
Requesting the blob: URL:
Requesting the URL without the blob: protocol:
Expected behavior
The diagram images would be sharable like any image asset on the website: copying the link and when copying the URL shown when viewing the image.
Some extra info: I believe this is a Mermaid thing, which means the same behavior exists across our doc sites. I personally would like the option to Save Image when I right click on a diagram, but I’m not given that option because of the way the diagrams are rendered. I’m mentioning it here because maybe the fix to Jeremiah’s issue will/could involve this piece as well.
Since Mermaid renders diagrams as SVGs in the browser, I found that it's possible to serialize the generated SVG into a Base64 string, making it technically "shareable" (see below). However, this approach may run into issues with some browsers due to URL length limitations.
I also explored an option to enable downloading the SVG with a button click.
Both approaches would not solve the "linkable" issue since the downloaded SVG or Base64 encoded SVG would be static, any suggestions?
I'm aware this has been open for a while. I'm full with work for the next two weeks so I'm un-tagging myself in case anyone wants to pick it up in the interim. Otherwise I'll check in again when the immediate deadlines have passed.