You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Subject: Images using base64 encoded data uris are being converted to local embed paths
Problem
When upgrading from sphinx 1.4.4 to 1.6.5 I have found a change in behaviour for image nodes that are using base64 encoded svgs, as data uris. Where previously they had preserved the data uri value, they are now being copied to the doctree images/embeded/.svg location. This breaks my existing logic because the absolute path is now local, and the images no longer work when the generated content is posted to a server.
I am not sure if this is related to the changes in #3589 and #3860. But that looks like it could be.
How to I ensure that my data uri is left unmodified so that it can be embedded in the generated content and not loaded from the filesystem?
Procedure to reproduce the problem
Use a custom directive or build the docutil nodes manually, and use a data uri for an image node:
It appears that sphinx.builders.Builder.supported_data_uri_images is a new magic undocumented property that fixes my issue if I set it to True on my custom builder class:
Subject: Images using base64 encoded data uris are being converted to local embed paths
Problem
When upgrading from sphinx 1.4.4 to 1.6.5 I have found a change in behaviour for image nodes that are using base64 encoded svgs, as data uris. Where previously they had preserved the data uri value, they are now being copied to the doctree images/embeded/.svg location. This breaks my existing logic because the absolute path is now local, and the images no longer work when the generated content is posted to a server.
I am not sure if this is related to the changes in #3589 and #3860. But that looks like it could be.
How to I ensure that my data uri is left unmodified so that it can be embedded in the generated content and not loaded from the filesystem?
Procedure to reproduce the problem
Use a custom directive or build the docutil nodes manually, and use a data uri for an image node:
Error logs / results
The node is later transformed to:
Expected results
I would expect to keep the data uri unmodified so that it can be directly embedded instead of loaded from the filesystem.
Environment info
The text was updated successfully, but these errors were encountered: