links in included svg are not active

if i create an svg file with links, and open into a browser, the links are active.
when added to a notebook as a file attachment and displayed as a cell, the links are not sensitive.
that is, neither does the cursor change when an element with a link is moused over, nor does a click work.
if, however, the inspector is used to open the respective blob, the svg is displayed in its own window with active links.

is there some special procedure to keep the links active when the svg is present in the notebook?

Let’s suppose that your FileAttachement looks like so:

svg_with_link = FileAttachment("svg_with_link.svg")

Then, try to display it as an SVG as follows:

svg`${await svg_with_link.text()}`

Assuming you’re got a well formed SVG with proper links, that should work.

If you’re trying

svg_with_link.image()

then I don’t think it will work.

the initial result was just what the “<-” button produces: the “.image()” version.

the svg operator does work, but i observe that care must be taken to supply content which contains an svg element only.
that is, if the document follows the standard svg conventions, in that is includes a prolog, then the cell appears empty.

I’m really not sure what you mean. It’s generally best to include working code - ideally, a link to a notebook. :confused:

in order that a document which was generated by graphvis would display, i had to remove the first few lines at the start:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.39.20140512.0445 (20140512.0445)
 -->
<!-- Title: value_expectations Pages: 1 -->

i did not investigate wheter it was the xml declaration, the doctype or the comments.

a related issue is that, for both absolute url links and those which specify just the anchor, the effect of activating the link is to redisplay the browser page with just cell source, but no cell results.
in one cell it indicates " observablehq.com refused to connect.".
if, however, one indicates that the linked document is to be opened in a new window, the result is as expected.

is this an issue with the page v/s cell domains?

the document is :

https://observablehq.com/@datagenous/value-expectations-investigations

@lomoramic Looks like you may still need to share that notebook?

Thanks for reporting, I’ve filed an internal issue. In the meantime you can add target="_parent" to your SVG links to have them open in the parent context.

adding the target attribute worked.