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

SVGs fail to render on python.org #701

Closed
ncoghlan opened this issue Jul 8, 2018 · 3 comments
Closed

SVGs fail to render on python.org #701

ncoghlan opened this issue Jul 8, 2018 · 3 comments
Assignees

Comments

@ncoghlan
Copy link
Contributor

ncoghlan commented Jul 8, 2018

After I switched the process diagram in PEP 1 from a PNG to an SVG, it stopped rendering at https://www.python.org/dev/peps/pep-0001/#pep-review-resolution even though it renders correctly locally (it's listing the filename instead of actually showing the diagram)

@ncoghlan ncoghlan self-assigned this Jul 8, 2018
@ncoghlan
Copy link
Contributor Author

ncoghlan commented Jul 8, 2018

Looking at the generated source code, the SVG is getting adding as an HTML "object", rather than as an "img", which I'm guessing means that the image processing logic in https://github.com/python/pythondotorg/blob/master/peps/converters.py#L231 isn't triggering properly.

If I can work out how to do it, I expect the simplest fix will be to get the HTML to render with an img tag instead, but failing that, then I may need to work out how to get python.org's PEP rendering to handle HTML object tags in addition to images.

(@berkerpeksag Any suggestions on how tricky the last option might be?)

@ncoghlan
Copy link
Contributor Author

ncoghlan commented Jul 8, 2018

It looks like this is coming from an old docutils rendering setting that aims to make SVGs compatible with IE6: https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/docutils/writers/html4css1/__init__.py

@ncoghlan ncoghlan changed the title SVG not rendering in PEP 1 SVGs fail to render on python.org Jul 8, 2018
@ncoghlan
Copy link
Contributor Author

ncoghlan commented Jul 8, 2018

#702 works around the immediate problem with PEP 1 by going back to a fixed size PNG (400x200).

Beyond that, I'm going to close this issue in favour of #2, since a big part of the problem here is that we're using docutils directly, with a dedicated PEP specific HTML writer that's generating HTML 4.1 with assorted legacy IE6 backwards compatibility cruft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant