jgraph / drawio-desktop

Official electron build of draw.io
https://www.diagrams.net
Apache License 2.0
49.89k stars 4.97k forks source link

Hyperlink on some of the objects not working when we convert vision file to svg #1870

Open janakmistry opened 1 day ago

janakmistry commented 1 day ago

We are using jgraph/drawio-desktop VERSION 24.2.5 to convert visio file to svg. We observed that hyperlink on some of the objects not working in converted svg file. Following is example. Screenshot from 2024-09-20 19-14-36

Hyperlinks in objects with black text are working. But objects with red text are not working.

We did further checks and found that objects with red text are converted differently than objects with black text.

Code of black text object: Screenshot from 2024-09-20 19-26-01 Above code object text is in anchor tag so hyperlink is working

Code of red text object: Screenshot from 2024-09-20 19-30-19 In this code object text is outside of anchor tag so hyperlink is not working

Here I am attaching converted svg file

<svg height="427px" id="visiosvg" version="1.1" viewBox="-0.5 -0.5 976 427" width="976px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs/><g><a xlink:href="https://www.google.com" xlink:title=""><g><path d="M 0 86.5 L 104 0 L 208 86.5 L 104 173 L 0 86.5" fill="none" pointer-events="all" stroke="#000000" stroke-miterlimit="10"/></g></a><g><rect fill="none" height="130.3" pointer-events="all" stroke="none" width="173.74" x="17.37" y="20.98"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject height="100%" pointer-events="none" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;" width="100%"><div style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 176px; height: 1px; padding-top: 86px; margin-left: 16px;" xmlns="http://www.w3.org/1999/xhtml"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center; width: 174px; max-height: 130px; overflow: hidden;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; width: 100%; white-space: normal; overflow-wrap: normal;"><div style="font-size: 1px"><p style="text-align:center;margin-left:0;margin-right:0;margin-top:0px;margin-bottom:0px;text-indent:0;vertical-align:middle;direction:ltr;"><font style="font-size:19.76px;font-family:Arial;color:#ff0000;direction:ltr;letter-spacing:0px;line-height:120%;opacity:1"><b>Decision</b></font><font style="font-size:19.76px;font-family:Arial;color:#ff0000;direction:ltr;letter-spacing:0px;line-height:120%;opacity:1"><br /></font></p></div></div></div></div></foreignObject><text fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle" x="104" y="90">Decision</text></switch></g></g><a xlink:href="https://www.google.com" xlink:title=""><g><path d="M 408 412 L 563 412 L 563 304 L 408 304 L 408 412" fill="none" pointer-events="all" stroke="#000000" stroke-miterlimit="10"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject height="100%" pointer-events="none" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;" width="100%"><div style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 157px; height: 1px; padding-top: 358px; margin-left: 407px;" xmlns="http://www.w3.org/1999/xhtml"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center; width: 155px; max-height: 108px; overflow: hidden;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; width: 100%; white-space: normal; overflow-wrap: normal;"><div style="font-size: 1px"><font style="font-size: 19.76px; font-family: Arial; color: rgb(0, 0, 0); direction: ltr; letter-spacing: 0px; line-height: 120%; opacity: 1; font-weight: bold; font-style: italic; text-decoration: underline;"><b>Process<br /></b></font></div></div></div></div></foreignObject><text fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle" x="486" y="362">Process
</text></switch></g></g></a><a xlink:href="https://www.google.com" xlink:title=""><g><path d="M 123 410 L 123 290 L 303 290 L 303 410 C 276.33 390.01 239.67 390.01 213 410 C 186.33 430 149.67 430 123 410" fill="none" pointer-events="all" stroke="#000000" stroke-miterlimit="10"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject height="100%" pointer-events="none" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;" width="100%"><div style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 182px; height: 1px; padding-top: 358px; margin-left: 122px;" xmlns="http://www.w3.org/1999/xhtml"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center; width: 180px; max-height: 135px; overflow: hidden;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; width: 100%; white-space: normal; overflow-wrap: normal;"><div style="font-size: 1px"><font style="font-size: 19.76px; font-family: Arial; color: rgb(0, 0, 0); direction: ltr; letter-spacing: 0px; line-height: 120%; opacity: 1; font-weight: bold; font-style: italic; text-decoration: underline;"><b>Document<br /></b></font></div></div></div></div></foreignObject><text fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle" x="213" y="361">Document
</text></switch></g></g></a><a xlink:href="https://www.google.com" xlink:title=""><g><path d="M 581.31 144 L 734.31 144 L 791.69 30 L 638.69 30 L 581.31 144" fill="none" pointer-events="all" stroke="#000000" stroke-miterlimit="10"/></g></a><g><rect fill="none" height="114.97" pointer-events="all" stroke="none" width="102.2" x="635.55" y="29.03"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject height="100%" pointer-events="none" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;" width="100%"><div style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 104px; height: 1px; padding-top: 87px; margin-left: 635px;" xmlns="http://www.w3.org/1999/xhtml"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center; width: 102px; max-height: 115px; overflow: hidden;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; width: 100%; white-space: normal; overflow-wrap: normal;"><div style="font-size: 1px"><font style="font-size:19.76px;font-family:Arial;color:#ff0000;direction:ltr;letter-spacing:0px;line-height:120%;opacity:1"><b>Data<br /></b></font></div></div></div></div></foreignObject><text fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle" x="687" y="90">Data
</text></switch></g></g><a xlink:href="https://www.google.com" xlink:title=""><g><path d="M 828 403.59 C 828 410.44 793.3 416 750.5 416 C 707.7 416 673 410.44 673 403.59 L 673 312.41 C 673 305.56 707.7 300 750.5 300 C 793.3 300 828 305.56 828 312.41 L 828 403.59" fill="none" pointer-events="all" stroke="rgb(0, 0, 0)" stroke-miterlimit="10"/><path d="M 673 312.41 C 673 319.27 707.7 324.82 750.5 324.82 C 793.3 324.82 828 319.27 828 312.41 M 673 325.9 C 673 332.76 707.7 338.31 750.5 338.31 C 793.3 338.31 828 332.76 828 325.9 M 673 319.15 C 673 326.01 707.7 331.56 750.5 331.56 C 793.3 331.56 828 326.01 828 319.15" fill="none" pointer-events="all" stroke="rgb(0, 0, 0)" stroke-miterlimit="10"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject height="100%" pointer-events="none" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;" width="100%"><div style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 157px; height: 1px; padding-top: 358px; margin-left: 672px;" xmlns="http://www.w3.org/1999/xhtml"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center; width: 155px; max-height: 116px; overflow: hidden;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; width: 100%; white-space: normal; overflow-wrap: normal;"><div style="font-size: 1px"><font style="font-size: 19.76px; font-family: Arial; color: rgb(0, 0, 0); direction: ltr; letter-spacing: 0px; line-height: 120%; opacity: 1; font-weight: bold; font-style: italic; text-decoration: underline;"><b>Data Store<br /></b></font></div></div></div></div></foreignObject><text fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle" x="751" y="362">Data Store
</text></switch></g></g></a><a xlink:href="https://www.google.com" xlink:title=""><g><rect fill="none" height="153" pointer-events="all" stroke="none" width="204" x="307" y="11"/></g></a><g><path d="M 409 164 L 511 87.5 L 409 11 L 307 87.5 L 409 164" fill="none" pointer-events="all" stroke="rgb(0, 0, 0)" stroke-miterlimit="10"/></g><g><rect fill="none" height="57.15" pointer-events="all" stroke="none" width="84.66" x="366.87" y="58.78"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject height="100%" pointer-events="none" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;" width="100%"><div style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 87px; height: 1px; padding-top: 87px; margin-left: 366px;" xmlns="http://www.w3.org/1999/xhtml"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center; width: 85px; max-height: 57px; overflow: hidden;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; width: 100%; white-space: normal; overflow-wrap: normal;"><div style="font-size: 1px"><font style="font-size:16.93px;font-family:Arial;color:#ff0000;direction:ltr;letter-spacing:0px;line-height:120%;opacity:1"><b>Gateway<br /></b></font></div></div></div></div></foreignObject><text fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle" x="409" y="91">Gateway
</text></switch></g></g><a xlink:href="https://www.google.com" xlink:title=""><g><rect fill="none" height="132" pointer-events="all" stroke="none" width="102" x="862" y="21"/></g></a><g><path d="M 964 59.02 L 927.28 59.02 L 927.28 21 L 862 21 L 862 153 L 964 153 L 964 59.02 M 964 55.85 L 927.28 21 L 927.28 59.02 L 964 59.02 L 964 55.85" fill="none" pointer-events="all" stroke="#000000" stroke-miterlimit="10"/></g><g><rect fill="none" height="29.36" pointer-events="all" stroke="none" width="120.92" x="852.64" y="153"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject height="100%" pointer-events="none" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;" width="100%"><div style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 123px; height: 1px; padding-top: 168px; margin-left: 852px;" xmlns="http://www.w3.org/1999/xhtml"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center; width: 121px; max-height: 29px; overflow: hidden;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; width: 100%; white-space: normal; overflow-wrap: normal;"><div style="font-size: 1px"><font style="font-size:19.76px;font-family:Arial;color:#ff0000;direction:ltr;letter-spacing:0px;line-height:120%;opacity:1"><b>Data Object<br /></b></font></div></div></div></div></foreignObject><text fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle" x="913" y="171">Data Object
</text></switch></g></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a target="_blank" transform="translate(0,-5)" xlink:href="#" xlink:title=""><text font-size="10px" text-anchor="middle" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>

Is there any solution for this issue?

davidjgraph commented 1 day ago

Could you try the latest build please.