Open cderv opened 1 year ago
While I would love to see SVGs embedded in a way that surfaces their DOM (and therefore makes them more accessible), I would also note alternative solutions to <object>
or <embed>
. SVGs operate like <iframe>s
but without the ability to impose any security sandbox.
There was some talk about either:
<object>
and <embed>
and bringing their auto-sizing capability to <iframe>
for SVGs, orsandbox
attribute to <object>
or <embed>
.I don't know that it's gone anywhere since last November, though.
Maybe you could write a Lua filter that uses an <object>
and <embed>
for a local SVG or an <img>
for a remote one as a rough trust heuristic?
A use cases for <object>
instead of <iframe>
is to allow links in images pointing to other parts of the publication.
This is possible in knitr following discussion at https://github.com/yihui/knitr/issues/2152 by opting in using option
options(knitr.svg.object = TRUE)
. Unfortunately, this does not work in Quarto because we don't use knitr plot hooks.This is important for accessibility as explained by @jooyoungseo at https://github.com/yihui/knitr/issues/2152#issuecomment-1218920811.
When
embed-resources: true
,<svg>
will be included but whenembed-resources: false
,<img>
will be used.This treatment for SVG file was discussed in Pandoc at
but solution recommended there was too use a Lua filter to create the
<object>
when this is a svg file.I suggest we do the same in our Lua filter in Quarto.
cc @jooyoungseo