Closed dangunter closed 3 days ago
You should use the underscore the target layer above
layers: {
one: {
ping: {
link: _.layers.two
}
}
two: {
pong: {
link: _.layers.one
}
}
}
But as for why it's linking to new SVGs that don't exist -- I'll look into. Thank you
that seems besides the point? the path is ok, it just doesn't append a suffix. maybe this is really a core error in how links are done with layers, though, and not related to tala
the path being close is just coincidence. if you link correctly, it gives the correct url.
but yes this is a D2 issue in general -- I've transferred it over. Thanks
The multi-layer SVG output renders the
link
keyword as hyperlinks to new layers in separate SVG files using both -- I assume for some backwards compatibility reasons, though this seems overly conservative -- bothhref
andxlink:href
in an<a>
element. Unfortunately the target of the links is missing the ".svg" suffix and therefore the links do not work.minimal example to reproduce:
Command:
d2 filename.d2
Note: Manually adding ".svg" suffixes to the links will fix this example, but of course this is not how it should be done.
Fix: add ".svg" to the
href
(thexlink:href
should be removed imho) generated in response to thelink
element, when rendering as SVG.