Navigation Menu

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

proposal: x/playground: support SVG images in output #59828

Open
zellyn opened this issue Apr 25, 2023 · 2 comments
Open

proposal: x/playground: support SVG images in output #59828

zellyn opened this issue Apr 25, 2023 · 2 comments
Labels
Milestone

Comments

@zellyn
Copy link

zellyn commented Apr 25, 2023

The Go playground currently supports displaying images if your output consists of the string "IMAGE:" followed by a base64-encoded PNG (or, presumably because browsers are permissive, GIF).

It would be nice to support SVG images too. The patch is very small: in fact, I created a change (in the wrong place!), but @dmitshur suggested a discussion here would be appropriate. The necessary diff can be seen here.

@gopherbot gopherbot added this to the Proposal milestone Apr 25, 2023
@ianlancetaylor ianlancetaylor changed the title proposal: x/website (small): support SVG images in playground output proposal: x/playground: support SVG images in output Apr 25, 2023
@zellyn
Copy link
Author

zellyn commented Apr 26, 2023

I would also appreciate guidance on where exactly to make the change(s). I see three places in the golang org that seem to include the IMAGE-rendering code.

@zellyn
Copy link
Author

zellyn commented Apr 26, 2023

One further note. I believe scripting is disabled in SVG images embedded using the <image> tag. MDN states it explicitly for Gecko, and in my tests, Chrome does the same thing, although I'm not familiar enough with the blink sources to validate it in code (despite trying for a while!).

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

No branches or pull requests

2 participants