(Optionally) enable interactivity for SVGs
Closed this issue · 1 comments
SVGs can contain interactivity, e.g. links to other sites, etc. Currently, SVGs are rendered to img
tags with base64 encoded values, at least in Documenter.jl, which breaks this interactivity. This causes, for instance, links in Mermaid diagrams to not work. To enable the interactivity, an SVG would have to be either embedded directly into the final HTML, or be included through an object
tag. See this blog post for some in-depth discussion on different approaches for embedding SVGs.
Given that there is a trade-off between the different approaches enabling interactivity should be optional (and likely default to the current approach or something similar). It's probably easiest to reuse the existing options
functionality of Diagram
s for this, but that is specifically intended for options that should be passed on to Kroki. This option is more relevant towards rendering, so a separate set of options/configuration is probably preferred.
This seems unlikely to be something that can be made to work currently. Interactivity requires the securityLevel
for Mermaid to be set to loose
1. As of Mermaid v8.2 securityLevel
is set to strict
by default, disabling interactivity2. Although it is possible to pass some configuration options to Mermaid, for security reasons, securityLevel
is in the list of options that is ignored3.