-
Notifications
You must be signed in to change notification settings - Fork 482
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
put svg with xmlns in img src tag #1538
Conversation
Could you also include a few additional test cases here: https://github.com/JuliaDocs/Documenter.jl/blob/master/test/examples/src/man/tutorial.md#including-images-with-mime It would be good to have a small matrix of cases there, e.g. whether the |
Would that be purely visual tests, checked manually? Because I don't think I can write a test that detects a browser's ability to show the embedded svg :) |
I've made the following changes now: SVG stays utf-8, with minimal changes to keep it from corrupting the surrounding html. I think that can also be nice if something doesn't look quite as expected, one can still inspect the SVG string manually in the browser, which doesn't work with base64. And base64 seems to inflate the size anyway. I splice in the xmlns tag if it's not there, I couldn't find reasons why I shouldn't. I've added a couple test cases on the page you linked. |
I'd like to bump this as Makie's documentation could really use a simpler way to return svg's from example blocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @jkrumbiegel, this dropped off my radar. Let's get this wrapped up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Do you mind using Documente#master
for Makie for a while though? I would like to leave this change for 0.27, but I don't want to rush that. This can easily be done if you commit the docs/Manifest.toml
.
Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
No I don't mind using master, thanks for helping to push this over the finish line. |
I experienced the same problem with Jupyter notebooks, so maybe it would be useful to add the same fix to IJulia? xref: https://discourse.julialang.org/t/cairomakie-and-fontconfig/55931/17?u=devmotion |
Thanks for iterating on this @jkrumbiegel! |
Did this PR fix the "text in SVG images gets corrupted" issue? Still seeing this problem... |
Yes, but it's only on master for now |
OK, thanks (and for the fix!). I'll put my doc updates aside for a while... |
If you have some docs that need this now, I would suggest just using |
This fixes #1537
A small test I made with Luxor, to show that inline svgs are correctly scaled down to fit the column width:
before:
after: