Skip to content
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

sphinx.ext.graphviz: use <object> instead of <img> to embed svg #2176

Merged
merged 2 commits into from
Dec 19, 2015

Conversation

xuhdev
Copy link
Contributor

@xuhdev xuhdev commented Dec 16, 2015

If svg files are embedded in <img> in html, all interactive features are
lost, which graphviz is able to produce. This commit replace <img> with
<object> for svg files.

@xuhdev
Copy link
Contributor Author

xuhdev commented Dec 16, 2015

This should offer a simpler solution than #2014 and can solve #967

If svg files are embedded in <img> in html, all interactive features are
lost, which graphviz is able to produce. This commit replace <img> with
<object> for svg files.

Close sphinx-doc#967
@tk0miya
Copy link
Member

tk0miya commented Dec 16, 2015

LGTM! Good suggestion :-)

@xuhdev
Copy link
Contributor Author

xuhdev commented Dec 16, 2015

A note here: to make sure href in svg files works, target must be set to an appropriate value, e.g., _top or _blank (such as <a xlink:href="http://sphinx-doc.org" target="_top"> in the svg file). Otherwise, the browser would try to show the new page inside the svg frame.

tk0miya added a commit that referenced this pull request Dec 19, 2015
sphinx.ext.graphviz: use <object> instead of <img> to embed svg
@tk0miya tk0miya merged commit e568f03 into sphinx-doc:stable Dec 19, 2015
@tk0miya
Copy link
Member

tk0miya commented Dec 19, 2015

Thanks a lot!

@xuhdev xuhdev deleted the graphviz-interactive-svg branch December 19, 2015 06:18
tk0miya added a commit that referenced this pull request Dec 19, 2015
@tk0miya tk0miya added this to the 1.3.4 milestone Dec 19, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants