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
Differing behaviour in html5 output for an svg image with align specified #7112
Comments
Thank you for reporting. I posted #7114 to fix this. Note: Sphinx does not apply any hyperlinks to SVG images because it can have its own hyperlinks. This is difference between other images formats. |
Awesome, thanks! Would you know the reason why SVGs need to be wrapped in divs, instead of just being treated like other images? |
Good point. Originally, HTML builder uses |
Fix #7112: html: SVG image is not layouted as float even if aligned
I updated my PR not to use |
Describe the bug
When an image is specified, similar to:
This code:
sphinx/sphinx/writers/html5.py
Lines 552 to 554 in d4aeae4
Sticks the svg (for unknown reasons) in a div and somehow also makes it clickable (so adds an internal reference, even though no
target
has been specified).The clickable reference is added by this code:
sphinx/sphinx/builders/html.py
Lines 808 to 825 in d4aeae4
Apparently the clickable thing is a feature(?).
As it's specified in a div, this displayed in
block
style, which means content does not flow around it, but is displayed below the image. This is different to how alignment works on images.e.g.:
To Reproduce
Try rendering an svg to html5
Expected behavior
The svg should behave no different to any other image - it should be styled inline and there should be no reference generated when no
target
is specified, e.g.:Your project
N/A
Screenshots
If applicable, add screenshots to help explain your problem.
Environment info
Additional context
N/A
The text was updated successfully, but these errors were encountered: