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

mermaid.live - export svg - svg image error #796

Closed
mmattel opened this issue May 18, 2022 · 1 comment · Fixed by #867
Closed

mermaid.live - export svg - svg image error #796

mmattel opened this issue May 18, 2022 · 1 comment · Fixed by #867
Labels
bug Something isn't working

Comments

@mmattel
Copy link

mmattel commented May 18, 2022

Describe the bug
When you render an image on mermaid.live and export the image to svg,
image
the image exported contains an error: Namespace prefix xlink for href on a is not defined

This is because of: https://stackoverflow.com/questions/59138117/svg-namespace-prefix-xlink-for-href-on-image-is-not-defined

Note that this does not happen when you click
image
and do right click - download image on the new tab

To Reproduce
Create an image with:

sequenceDiagram
    participant Client
    participant Graph
    participant SpaceA
    participant SpaceB
    links Client: {"web": "https://owncloud.dev/clients/web/", "RClone": "https://owncloud.dev/clients/rclone/"}
    link Graph: Documentation @ https://owncloud.dev/extensions/graph/

    Note left of Client:  First, a clients looks<br/>up the spaces a user has access to
    opt space lookup
        Client->>+Graph: GET /me/drives
        Graph-->>-Client: 200 OK JSON list of spaces, say A, B and C,<br/> each with a dedicated webDavURL, etag and quota
    end

    Note left of Client: Then it can do a parallel<br/>sync discovery on spaces<br/>whose etag changed
    par Client to Space A
        Client->>+SpaceA: PROPFIND {webDavURL for Space A}
        SpaceA-->>-Client: 207 Multistatus PROPFIND response
    and Client to Space B
        Client->>+SpaceB: PROPFIND {webDavURL for space B}
        SpaceB-->>-Client: 207 Multistatus PROPFIND response
    end

and export it to SVG.
Then try to open the SVG with a browser.

Expected behavior
No error output

Screenshots
image

Desktop (please complete the following information):

  • OS: Win64 / Ubuntu 20.04
  • Browser: Opera / Chrome
  • Version: latest

Fix Proposal
When changing the following manually in the svg image exported, all is fine and free of errors:
xmlns="http://www.w3.org/2000/svg" -->
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"

@sidharthv96 FYI (hopefully you can fix this)

@sidharthv96
Copy link
Member

@mmattel, I've fixed the issue using a workaround in live editor.
The actual fix needs to go in mermaid. I've raised mermaid-js/mermaid#3184 for that.

sidharthv96 added a commit that referenced this issue Jul 6, 2022
* master:
  fix #796: Export SVG fix
  Fix loading tests
  Bind correct store
  add update test
  Fix #851: Simplify data flow and error handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants