Opened 14 years ago
Last modified 9 years ago
#9689 new defect
Links on SVG images do not work
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | lowest | Milestone: | next-major-releases |
Component: | rendering | Version: | 0.12-stable |
Severity: | normal | Keywords: | SVG external Links embed |
Cc: | Thijs Triemstra | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I have a SVG graphic with external links. I can open this graphic in my web browser and get redirected to the external links (by clicking on the image). After attaching this image to a wiki post (in trac), this is no longer possible. I attached the SVG I tried to upload in a wiki.
Attachments (1)
Change History (13)
by , 14 years ago
Attachment: | iteraplanLandscapeDiagram.svg added |
---|
comment:1 by , 14 years ago
Keywords: | SVG external Links added |
---|---|
Milestone: | → 0.12.2 |
follow-up: 3 comment:2 by , 14 years ago
Milestone: | 0.12.2 |
---|---|
Version: | → 0.12-stable |
took the liberty to set the correct version (assuming the creater of the ticket actually meant to specify the version he is/was using) and remove the target milestone
follow-up: 4 comment:3 by , 14 years ago
Replying to Stefan:
took the liberty to set the correct version (assuming the creater of the ticket actually meant to specify the version he is/was using) and remove the target milestone
hm… the ticket still shows up in the roadmap overview, even though I set the milestone to "". Did I do something wrong? http://trac.edgewall.org/query?group=status&milestone=0.12.2
comment:4 by , 14 years ago
Replying to Stefan:
Replying to Stefan:
took the liberty to set the correct version (assuming the creater of the ticket actually meant to specify the version he is/was using) and remove the target milestone
hm… the ticket still shows up in the roadmap overview, even though I set the milestone to "". Did I do something wrong? http://trac.edgewall.org/query?group=status&milestone=0.12.2
nevermind… was too quick with the reply —- everything seems correct :)
comment:5 by , 14 years ago
Thanks ;) I wasn't sure about the Milestone. But what is the solution to the problem?
follow-ups: 8 10 comment:6 by , 14 years ago
Component: | general → rendering |
---|---|
Keywords: | embed added |
Milestone: | → next-major-0.1X |
Priority: | normal → lowest |
Indeed, the Image macro allows you to see SVG images, in browsers that support SVG content in <img>
tags. However, it seems that they don't activate the links in this case (read for example this instructive discussion in the case of Firefox. Chrome, Safari and IE9 in my testing also don't activate the embedded links. Opera proposes you to download the file…
So to achieve what you want, you must embed the SVG using another tag, like the <embed>
tag, which is what the TH:TracImageSvgMacro does.
We might add a proper Embed macro one day, keeping the ticket on the radar.
comment:8 by , 14 years ago
Cc: | added |
---|
Replying to cboos:
Chrome, Safari and IE9 in my testing also don't activate the embedded links. Opera proposes you to download the file…
fwiw, when I open the .svg directly in Safari 4.1.2 on osx 10.4.11 it responds normally to the links and opens them.
comment:9 by , 13 years ago
Cc: | added; removed |
---|
comment:10 by , 12 years ago
Replying to cboos:
So to achieve what you want, you must embed the SVG using another tag, like the
<embed>
tag, which is what the TH:TracImageSvgMacro does.
Just installed it (trac 1.0) and it doesn't work. It seems again there's no way to have SVGs with links, so please reopen this ticket.
Additionally, there doesn't seem to be any way to do image maps at all, neither this way, nor with raster image maps, as I couldn't get the usemap attribute of the Image macro to work either.
comment:11 by , 9 years ago
We should be able to use embedded svg if the page is served as HTML5. Ticket #5139 should be reopened, and we should serve with the HTML5 header, and allow the inline SVG to pass through. It is no longer a fringe thing to expect HTML5 embedded SVG or even MATHML, but you need to serve it with the proper doctype at least for the browser to try to render as such.
comment:12 by , 9 years ago
PatchWelcome, though it may be nontrivial since Genshi doesn't support all of HTML5 and we still use doctype XHTML_STRICT
: tags/trac-1.1.6/trac/web/chrome.py@:592#L591.
Clicking on "Employee" or "Current Account" in the image would normally redirect to an external web site.
Thank you in advance