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

Downloading SVG makes links non functional #319

Closed
ane-gabriela opened this issue Nov 21, 2024 · 2 comments · Fixed by #326
Closed

Downloading SVG makes links non functional #319

ane-gabriela opened this issue Nov 21, 2024 · 2 comments · Fixed by #326
Assignees

Comments

@ane-gabriela
Copy link

ane-gabriela commented Nov 21, 2024

Seems to be a regression for #130

Steps to reproduce:

  1. Create a new Diagram

  2. Add some shapes

  3. Add a word in each shape

  4. Select the word from one of the shapes

  5. Click on the Link... button below Insert from the right panel

  6. Select a wiki page > Apply
    InternalPage

  7. Select another shape/word

  8. Click on the Link... button below Insert from the right panel

  9. Select External and paste an URL eg. https://en.wikipedia.org/wiki/Flower
    ExternalLink

  10. Click File > Export as > SVG...

  11. Click on Export

  12. Click on Download > Save

  13. Open the SVG

  14. Click on each of the links

Expected results: The links are showing as expected.

Actual results: When clicking on the link to the internal page it gives "javascript:void(0);" and the link to the external url doesn't work at all - it's just like text not a link.

Heading

Environment: XWiki 14.10.18 with Diagram version 1.21.1-rc-1, Chrome 131, Windows 11 Pro

@snazare snazare removed their assignment Nov 26, 2024
@Farcasut Farcasut moved this from Todo to In Progress in Pro Apps Roadmap October - November 2024 Dec 5, 2024
Farcasut added a commit to Farcasut/application-diagram-fork that referenced this issue Dec 5, 2024
 *This issue appears to be more nuanced because there are multiple ways to add links to a page, and there are different types of links. You can add a link directly by selecting the plus button, choosing either "internal" or "external," and adding it or by highlighting text and inserting the link.

  Regarding the types of links there are three categories:

      Custom: These are internal links within XWiki.
      External (prefixed): These links are prefixed with https://domain and work correctly, redirecting to the external site.
      External (non-prefixed): These links lack an https:// prefix. Instead of redirecting to the external site, they redirect to localdomain/externalLink.

  From my understanding, this behavior is not a bug but the intended design of drawio, as it can be reproduced on https://app.diagrams.net.

  To solve the issue raised by Gabrila, I can override the updateSvgLinks method in Graph.js and retain the custom links instead of removing them.

  As for the external non-prefixed links, I am unsure whether I should add the https:// prefix myself or retain drawio's default behavior.
@Farcasut Farcasut linked a pull request Dec 5, 2024 that will close this issue
Farcasut added a commit to Farcasut/application-diagram-fork that referenced this issue Dec 9, 2024
@ane-gabriela
Copy link
Author

Issue reproducing on XWiki 15.10.14, Chrome 131, Windows 11 Pro

Farcasut added a commit to Farcasut/application-diagram-fork that referenced this issue Dec 12, 2024
@Farcasut
Copy link

Farcasut commented Dec 13, 2024

The issue has been fixed, and everything should work as expected starting with version 1.22. To fix older diagrams(created in 1.21-1-rc-1) before exporting, resave them and make sure the cache is deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants