-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:loading: embed
on images does not work as expected
#12345
Comments
Hi @Johnnynator - thanks for the bugreport. Let's check if I understand your request correctly:
Could I also ask what behaviour And if possible: could you share more about the use-case(s) that you anticipate this would help with? In other words: not only the change in behaviour that you'd like, but the reasons why that could be beneficial in particular usage scenarios. |
https://docutils.sourceforge.io/docs/ref/rst/directives.html#footnote-4 Yep, base64 data uri for for most things, svg directly embedded as is into the html.
The loading attribute is only used for their html writer, other writers do ignore it. My usecase is primarly taking use of how svg's get styled differently when they are embeddes in the html document compared getting linked with e.g. . Makes it easier to have a single svg that can handle both light and dark mode. For normal images it would be beneficial to get rid of the ugly error message in the output html. |
Ok, thank you.
I'm not sure I understand this part - what's a situation where an embedded SVG is easier to style than an SVG included by using a (non-data)
Could you post some build logs including the error message? |
will inherit all the style of the document, so if you e.g. the
Build log:
Error Message on the Webpage:
|
First of all, thanks for the screenshot: when you mentioned that the error message appeared in the output in your previous messages, I misinterpreted that as being the Sphinx build logs -- I didn't realize that the error appears within the built project content itself (output is a perfectly valid way to refer to that). The SVG styling question seems to make some sense, but it is at-or-beyond the limits of my SVG/stylesheet experience; I'll try to learn some more about that. The |
A small concern I had about adding support for embedded SVGs is that there is no implicit namespace for each SVG file embedded within an HTML document. This can cause collisions between the |
heya yep agree that this should be in sphinx and is useful, |
Describe the bug
Sphinx refers to docutils for all
reST
behaviour (except where it extends it), so I would expect that:loading: embed
would work as documented by docutils (v0.21+).sphinx breaks
:loading: embed
in two scenarios:_images
path, so docutils can't read the image file (and not embed it) and prints an error in the outputHow to Reproduce
Environment Information
Sphinx extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: